Performance Optimizations for Applications using Azure Data Explorer

Published Apr 04 2022 11:26 PM 1,908 Views
Microsoft

In many cases Azure Data Explorer’s inbuilt query capabilities can reduce the need to provision traditional memory caching or other data sources which can increase the cost and complexities involved to synchronize and maintain fresh data. Azure Data Explorer can address specific caching requirements, common application querying scenarios and enable fast query response times where applications require fast access to real-time data. 

 

Now let's delve into some of the key concepts: 

 

Data Ingestion: 

Azure Data Explorer provides the capability to easily fetch telemetry data from a variety of data sources and run complex analytical queries. Azure Data Explorer supports both batch and streaming ingestion to support near real-time latency requirements. Batch ingestion will have latencies based on the batching policy and query frequency from applications. Streaming ingestion can be leveraged for low latency requirements. Data is cached and indexed for faster query performance and optionally exported out to Azure Data Lake in parquet format for batch processing and integration with other Big Data and Machine Learning (ML) services. 

 

ashokanms_0-1648779487501.png

Reference document: Azure Data Explorer data ingestion overview | Microsoft Docs

 

Data Transformation: 

Data transformation in Azure Data Explorer (ADX) can be performed using Update Policy. Update Policy is an extremely useful feature where data transformations can be applied in one place for data ingested from multiple sources. This is also a good design approach as it avoids building transformation logics in multiple ETL (extract, transform, load) jobs or streaming pipelines which may lead to maintenance of logic in many places and data issues - Kusto update policy - Azure Data Explorer | Microsoft Docs

 

Key considerations:

 

Hot Cache: 

Azure Data Explorer provides best query performance over the data stored in Hot Cache. Based on the requirements, we can set Cache Policy duration to store the data in the processing nodes (RAM or SSD's). Cache Policy can be set at the cluster, database, materialized view or table level - Cache policy (hot and cold cache) - Azure Data Explorer | Microsoft Docs

 

Retention Policies: 

Azure Data Explorer performance can further be enhanced by optimising retention policies. Retention policies deletes old records beyond the retention period. Retention policy can be set at database, materialized view or table level. Consider low retention policies for staging tables - Kusto retention policy controls how data is removed - Azure Data Explorer | Microsoft Docs

 

Data Enrichment from SQL database: 

Generally, application configuration and other static data is maintained in a relational database like Azure SQL which can be used to enrich device telemetry data. Azure Data Explorer provides SQL Plugin capability from which data can be retrieved from a SQL database and joined with the Azure Data Explorer tables - sql_request plugin - Azure Data Explorer | Microsoft Docs

 

Improve Query Response time for Applications:

There are various techniques to increase the overall throughput and decrease query latency in Azure Data Explorer. Incorporating the techniques described below significantly simplifies the design and maintenance of the application backend data. 

 

  1. Query results cache: 

When the same query is run multiple times, this option helps to return the query results faster from the cache. We can set "query_results_cache_max_age" option to specify the time for which cache should be retained. The other option is by setting “set query_results_cache_per_shard” which creates cache on each shard that holds the data. 

This feature is useful in cases where the same query is executed multiple times. With this, the query will use the cache and not scan the data each time which can help save compute. Query Results cache can be set using a simple command to set cache maximum age as minutes: 

ashokanms_2-1648785592489.png

 

 After this any identical queries made to the same database will get the data returned from the results cache. Beyond the timespan the cache is obsolete. Hence, this option is good when you intend to run same query for a limited time - Query results cache - Azure Data Explorer | Microsoft Docs

 

  1. Materialize Data 

materialize (): 

This function caches the subquery result during the time of query execution and other subqueries can reference the partial result. The core data is precomputed with expensive joins and aggregations and held as cache - materialize() - Azure Data Explorer | Microsoft Docs

 

Below are some basic queries to showcase the functionality which can be leveraged for data at scale. 

Sample Records in Events table: 

ashokanms_1-1648779976036.png

 

 Query with multiple tabular expression statements: 

ashokanms_2-1648785139487.png

 

 Subquery to fetch Data for state New South Wales: 

ashokanms_0-1648785411116.png

 

 Subquery to fetch data for state Victoria: 

ashokanms_1-1648785442167.png

 

Materialized_view(): 

This is one of the commonly asked for features for analytics use cases where the data needs to be pre-computed and stored for complex queries. In Azure Data Explorer we can create materialized views which are great in terms of performance for applications looking to query aggregated data over a large dataset. This avoids the need to access the base table for recomputation. The application can directly reference the materialized view to get up to date results. It is not required to trigger or refresh the materialized view as the computation happens automatically as the data arrives. 

 

Creating materialized view: 

ashokanms_7-1647896171045.jpeg

 

The materialized view can then be accessed using materialized view name. Reference: materialized_view() (scope function) - Azure Data Explorer | Microsoft Docs

Materialized view also solves the issue of duplication which may occur due to malfunctioning devices resending data - Handle duplicate data in Azure Data Explorer | Microsoft Docs

 

Note: We can further optimise the materialize () query by having low data retention policies for the base table (1 day or lower). 

 

  1. Stored Query Results: 

Stored query results is a mechanism that temporarily stores the result of a query which can be referenced in later queries. This feature is useful when applications require pagination over the stored query results and drilldown on the data from the initial query. Stored query results can be created, dropped and accessed for up to 24 hours after creation - Stored query results - Azure Data Explorer | Microsoft Docs

 

Query to store "stored query" results: 

ashokanms_8-1647896171049.jpeg

 

Retrieving stored query results from another query: 

ashokanms_3-1648786518461.png

 

  1. Database Cursors: 

 This feature can be leveraged by applications where there is a data query requirement to have a consistent view of data. The initial query can hold the latest cursor value and then supplied to all the accessing applications. This way the application owner can decide when to provide the latest data and ensure consistency across all applications accessing data. 

This feature is extremely useful for instances where the dashboards have a requirement to display the consistent information to all consuming users where some staleness is acceptable - Database cursors - Azure Data Explorer | Microsoft Docs

 

Let's see how this feature works with some basic queries: 

Fetch current cursor value using a query and note the cursor value: 

Cursor value: 637825901710610902

ashokanms_10-1647896171061.jpeg

 

 Insert some records to Events table: 

ashokanms_11-1647896171065.jpeg

 

The query can leverage "cursor_before_or_at" parameter to fetch the records before or at previously noted cursor values:

ashokanms_12-1647896171070.jpeg

 

The query can leverage "cursor_after" parameter to fetch only the latest records after previous previously noted cursor value: 

ashokanms_13-1647896171073.jpeg

 

 Based on the use case and end user caching requirements of applications, we can implement one or combination of these options. 

  

Consuming from Azure Data Explorer: 

 

Highly Concurrent Applications: 

For Applications with high concurrency needs, it is important to incorporate some of the design principles to ensure that user queries are not impacted when queries are submitted simultaneously to Azure data explorer. The document discusses on several optimization approaches that can be leveraged in Azure data explorer to design the backend architecture - Optimize for high concurrency with Azure Data Explorer | Microsoft Docs

 

Optimize Queries:  

Writing efficient queries is key to ensure that queries run in optimal fashion and return faster response - Query best practices - Azure Data Explorer | Microsoft Docs 

 

Consume Data: 

Azure Data Explorer API's provides wide variety of options where end users can query data based on requirements to be displayed in the application - Azure Data Explorer API Overview - Azure Data Explorer | Microsoft Docs

%3CLINGO-SUB%20id%3D%22lingo-sub-3262996%22%20slang%3D%22en-US%22%3EPerformance%20Optimizations%20for%20Applications%20using%20Azure%20Data%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3262996%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22TextRun%20SCXW71584403%20BCX8%22%20data-contrast%3D%22none%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3EIn%20many%20cases%20Azure%20Data%20Explorer%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E%E2%80%99s%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E%20inbuilt%20query%20capabilities%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecan%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ereduce%20the%20need%20to%20provision%20traditional%20memory%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecaching%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Eor%20other%20data%20sources%20which%20can%20increase%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ethe%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecost%20and%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecomplexities%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Einvolved%20to%20synchronize%20and%20maintain%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Efresh%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Edata%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E.%20Azure%20Data%20Explorer%20can%20address%20specific%20caching%20requirements%2C%20common%20application%20querying%20scenarios%20and%20enable%20fast%20query%20response%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Etimes%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ewhere%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Eapplications%20require%20fast%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E%20access%20to%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ereal-time%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Edata.%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22EOP%20SCXW71584403%20BCX8%22%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3ENow%20let's%20delve%20into%20some%20of%20the%20key%20concepts%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EData%20Ingestion%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EAzure%20Data%20Explorer%20provides%20the%20capability%20to%20easily%20fetch%20telemetry%20data%20from%20a%20variety%20of%20data%20sources%20and%20run%20complex%20analytical%20queries.%20Azure%20Data%20Explorer%20supports%20both%20batch%20and%20streaming%20ingestion%20to%20support%20near%20real-time%20latency%20requirements.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EBatch%20ingestion%20will%20have%20latencies%20based%20on%20the%20batching%20policy%20and%20query%20frequency%20from%20applications.%20Streaming%20ingestion%20can%20be%20leveraged%20for%20low%20latency%20requirements.%20Data%20is%20cached%20and%20indexed%20for%20faster%20query%20performance%20and%20optionally%20exported%20out%20to%20Azure%20Data%20Lake%20in%20parquet%20format%20for%20batch%20processing%20and%20integration%20with%20other%20Big%20Data%20and%20Machine%20Learning%20(ML)%20services.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_0-1648779487501.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360454i8CA5382E645B5799%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ashokanms_0-1648779487501.png%22%20alt%3D%22ashokanms_0-1648779487501.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EReference%20document%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fingest-data-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Data%20Explorer%20data%20ingestion%20overview%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EData%20Transformation%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EData%20transformation%20in%20Azure%20Data%20Explorer%20(ADX)%20can%20be%20performed%20using%20Update%20Policy.%20Update%20Policy%20is%20an%20extremely%20useful%20feature%20where%20data%20transformations%20can%20be%20applied%20in%20one%20place%20for%20data%20ingested%20from%20multiple%20sources.%20This%20is%20also%20a%20good%20design%20approach%20as%20it%20avoids%20building%20transformation%20logics%20in%20multiple%20ETL%20(extract%2C%20transform%2C%20load)%20jobs%20or%20streaming%20pipelines%20which%20may%20lead%20to%20maintenance%20of%20logic%20in%20many%20places%20and%20data%26nbsp%3Bissues%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fupdatepolicy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EKusto%20update%20policy%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CFONT%20size%3D%225%22%3E%3CEM%3E%3CSTRONG%3EKey%20considerations%3A%3C%2FSTRONG%3E%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EHot%20Cache%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EAzure%20Data%20Explorer%20provides%20best%20query%20performance%20over%20the%20data%20stored%20in%20Hot%20Cache.%20Based%20on%20the%20requirements%2C%20we%20can%20set%20Cache%20Policy%20duration%20to%20store%20the%20data%20in%20the%20processing%20nodes%20(RAM%20or%20SSD's).%20Cache%20Policy%20can%20be%20set%20at%20the%20cluster%2C%20database%2C%20materialized%20view%20or%20table%20level%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fcachepolicy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ECache%20policy%20(hot%20and%20cold%20cache)%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3ERetention%20Policies%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EAzure%20Data%20Explorer%20performance%20can%20further%20be%20enhanced%20by%20optimising%20retention%20policies.%20Retention%20policies%20deletes%20old%20records%20beyond%20the%20retention%20period.%20Retention%20policy%20can%20be%20set%20at%20database%2C%20materialized%20view%20or%20table%20level.%20Consider%20low%20retention%20policies%20for%20staging%20tables%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fretentionpolicy%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EKusto%20retention%20policy%20controls%20how%20data%20is%20removed%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EData%20Enrichment%20from%20SQL%20database%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EGenerally%2C%20application%20configuration%20and%20other%20static%20data%20is%20maintained%20in%20a%20relational%20database%20like%20Azure%20SQL%20which%20can%20be%20used%20to%20enrich%20device%20telemetry%20data.%20Azure%20Data%20Explorer%20provides%20SQL%20Plugin%20capability%20from%20which%20data%20can%20be%20retrieved%20from%20a%20SQL%20database%20and%20joined%20with%20the%20Azure%20Data%20Explorer%20tables%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fsqlrequestplugin%3Fpivots%3Dazuredataexplorer%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Esql_request%20plugin%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CEM%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EImprove%20Query%20Response%20time%20for%20Applications%3A%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThere%20are%20various%20techniques%20to%20increase%20the%20overall%20throughput%20and%20decrease%20query%20latency%20in%20Azure%20Data%20Explorer.%20Incorporating%20the%20techniques%20described%20below%20significantly%20simplifies%20the%20design%20and%20maintenance%20of%20the%20application%20backend%20data.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3E%20Query%20results%20cache%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EWhen%20the%20same%20query%20is%20run%20multiple%20times%2C%20this%20option%20helps%20to%20return%20the%20query%20results%20faster%20from%20the%20cache.%20We%20can%20set%20%22query_results_cache_max_age%22%20option%20to%20specify%20the%20time%20for%20which%20cache%20should%20be%20retained.%20The%20other%20option%20is%20by%20setting%20%E2%80%9Cset%20query_results_cache_per_shard%E2%80%9D%20which%20creates%20cache%20on%20each%20shard%20that%20holds%20the%20data.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThis%20feature%20is%20useful%20in%20cases%20where%20the%20same%20query%20is%20executed%20multiple%20times.%20With%20this%2C%20the%20query%20will%20use%20the%20cache%20and%20not%20scan%20the%20data%20each%20time%20which%20can%20help%20save%20compute.%20Query%20Results%20cache%20can%20be%20set%20using%20a%20simple%20command%20to%20set%20cache%20maximum%20age%20as%20minutes%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_2-1648785592489.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360469i7628AC496D0AF73B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_2-1648785592489.png%22%20alt%3D%22ashokanms_2-1648785592489.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EAfter%20this%20any%20identical%20queries%20made%20to%20the%20same%20database%20will%20get%20the%20data%20returned%20from%20the%20results%20cache.%20Beyond%20the%20timespan%20the%20cache%20is%20obsolete.%20Hence%2C%20this%20option%20is%20good%20when%20you%20intend%20to%20run%20same%20query%20for%20a%20limited%20time%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fquery-results-cache%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EQuery%20results%20cache%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3E%20Materialize%20Data%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%20aria-level%3D%224%22%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3Ematerialize%20()%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThis%20function%20caches%20the%20subquery%20result%20during%20the%20time%20of%20query%20execution%20and%20other%20subqueries%20can%20reference%20the%20partial%20result.%20The%20core%20data%20is%20precomputed%20with%20expensive%20joins%20and%20aggregations%20and%20held%20as%20cache%20-%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fmaterializefunction%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ematerialize()%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EBelow%20are%20some%20basic%20queries%20to%20showcase%20the%20functionality%20which%20can%20be%20leveraged%20for%20data%20at%20scale.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%3CFONT%20size%3D%223%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3ESample%20Records%20in%20Events%20table%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_1-1648779976036.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360456i45F741A02E97D426%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_1-1648779976036.png%22%20alt%3D%22ashokanms_1-1648779976036.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EQuery%20with%20multiple%20tabular%20expression%20statements%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_2-1648785139487.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360463iCEE29CA7B487A5BF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_2-1648785139487.png%22%20alt%3D%22ashokanms_2-1648785139487.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3ESubquery%20to%20fetch%20Data%20for%20state%20New%20South%20Wales%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_0-1648785411116.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360465i495F8C88109A5810%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_0-1648785411116.png%22%20alt%3D%22ashokanms_0-1648785411116.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3ESubquery%20to%20fetch%20data%20for%20state%20Victoria%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_1-1648785442167.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360467iE90CF4A7CE50F066%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_1-1648785442167.png%22%20alt%3D%22ashokanms_1-1648785442167.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%224%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EMaterialized_view()%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CLI-WRAPPER%3E%3CI%3E%3C%2FI%3E%3C%2FLI-WRAPPER%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThis%20is%20one%20of%20the%20commonly%20asked%20for%20features%20for%20analytics%20use%20cases%20where%20the%20data%20needs%20to%20be%20pre-computed%20and%20stored%20for%20complex%20queries.%20In%20Azure%20Data%20Explorer%20we%20can%20create%20materialized%20views%20which%20are%20great%20in%20terms%20of%20performance%20for%20applications%20looking%20to%20query%20aggregated%20data%20over%20a%20large%20dataset.%20This%20avoids%20the%20need%20to%20access%20the%20base%20table%20for%20recomputation.%20The%20application%20can%20directly%20reference%20the%20materialized%20view%20to%20get%20up%20to%20date%20results.%20It%20is%20not%20required%20to%20trigger%20or%20refresh%20the%20materialized%20view%20as%20the%20computation%20happens%20automatically%20as%20the%20data%20arrives.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3ECreating%20materialized%20view%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_7-1647896171045.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357402iBE84C29DD09D9E03%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_7-1647896171045.jpeg%22%20alt%3D%22ashokanms_7-1647896171045.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThe%20materialized%20view%20can%20then%20be%20accessed%20using%20materialized%20view%20name.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3BReference%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fmaterialized-view-function%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ematerialized_view()%20(scope%20function)%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EMaterialized%20view%20also%20solves%20the%20issue%20of%20duplication%20which%20may%20occur%20due%20to%20malfunctioning%20devices%20resending%20data%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fdealing-with-duplicates%23solution-3-use-materialized-views-to-deduplicate%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EHandle%20duplicate%20data%20in%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3ENote%3A%20We%20can%20further%20optimise%20the%20materialize%20()%20query%20by%20having%20low%20data%20retention%20policies%20for%20the%20base%20table%20(1%20day%20or%20lower).%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3E%20Stored%20Query%20Results%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EStored%20query%20results%20is%20a%20mechanism%20that%20temporarily%20stores%20the%20result%20of%20a%20query%20which%20can%20be%20referenced%20in%20later%20queries.%20This%20feature%20is%20useful%20when%20applications%20require%20pagination%20over%20the%20stored%20query%20results%20and%20drilldown%20on%20the%20data%20from%20the%20initial%20query.%20Stored%20query%20results%20can%20be%20created%2C%20dropped%20and%20accessed%20for%20up%20to%2024%20hours%20after%20creation%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fstored-query-results%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EStored%20query%20results%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EQuery%20to%20store%20%22stored%20query%22%20results%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_8-1647896171049.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357404iDF5F5869C2ADB8D0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_8-1647896171049.jpeg%22%20alt%3D%22ashokanms_8-1647896171049.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3ERetrieving%20stored%20query%20results%20from%20another%20query%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_3-1648786518461.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F360470i0A09F408D3D3B415%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_3-1648786518461.png%22%20alt%3D%22ashokanms_3-1648786518461.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3E%20Database%20Cursors%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EThis%20feature%20can%20be%20leveraged%20by%20applications%20where%20there%20is%20a%20data%20query%20requirement%20to%20have%20a%20consistent%20view%20of%20data.%20The%20initial%20query%20can%20hold%20the%20latest%20cursor%20value%20and%20then%20supplied%20to%20all%20the%20accessing%20applications.%20This%20way%20the%20application%20owner%20can%20decide%20when%20to%20provide%20the%20latest%20data%20and%20ensure%20consistency%20across%20all%20applications%20accessing%20data.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EThis%20feature%20is%20extremely%20useful%20for%20instances%20where%20the%20dashboards%20have%20a%20requirement%20to%20display%20the%20consistent%20information%20to%20all%20consuming%20users%20where%20some%20staleness%20is%20acceptable%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fmanagement%2Fdatabasecursor%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EDatabase%20cursors%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3ELet's%20see%20how%20this%20feature%20works%20with%20some%20basic%20queries%3A%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EFetch%20current%20cursor%20value%20using%20a%20query%20and%20note%20the%20cursor%20value%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3ECursor%20value%3A%20637825901710610902%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_10-1647896171061.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357405i369799C2AFD56AB4%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_10-1647896171061.jpeg%22%20alt%3D%22ashokanms_10-1647896171061.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EInsert%20some%20records%20to%20Events%20table%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_11-1647896171065.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357406iA03EA18C1130E415%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_11-1647896171065.jpeg%22%20alt%3D%22ashokanms_11-1647896171065.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EThe%20query%20can%20leverage%20%22cursor_before_or_at%22%20parameter%20to%20fetch%20the%20records%20before%20or%20at%20previously%20noted%20cursor%20values%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_12-1647896171070.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357407iFC8696D077F203AC%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_12-1647896171070.jpeg%22%20alt%3D%22ashokanms_12-1647896171070.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%225%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EThe%20query%20can%20leverage%20%22cursor_after%22%20parameter%20to%20fetch%20only%20the%20latest%20records%20after%20previous%20previously%20noted%20cursor%20value%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ashokanms_13-1647896171073.jpeg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F357408i01FF45312B178EDE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22ashokanms_13-1647896171073.jpeg%22%20alt%3D%22ashokanms_13-1647896171073.jpeg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3EBased%20on%20the%20use%20case%20and%20end%20user%20caching%20requirements%20of%20applications%2C%20we%20can%20implement%20one%20or%20combination%20of%20these%20options.%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%222%22%3E%3CEM%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EConsuming%20from%20Azure%20Data%20Explorer%3A%3C%2FSTRONG%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EHighly%20Concurrent%20Applications%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335551550%26quot%3B%3A1%2C%26quot%3B335551620%26quot%3B%3A1%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EFor%20Applications%20with%20high%20concurrency%20needs%2C%20it%20is%20important%20to%20incorporate%20some%20of%20the%20design%20principles%20to%20ensure%20that%20user%20queries%20are%20not%20impacted%20when%20queries%20are%20submitted%20simultaneously%20to%20Azure%20data%20explorer.%20The%20document%20discusses%20on%20several%20optimization%20approaches%20that%20can%20be%20leveraged%20in%20Azure%20data%20explorer%20to%20design%20the%20backend%20architecture%20-%26nbsp%3B%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fhigh-concurrency%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOptimize%20for%20high%20concurrency%20with%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EOptimize%20Queries%3A%20%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335551550%26quot%3B%3A1%2C%26quot%3B335551620%26quot%3B%3A1%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EWriting%20efficient%20queries%20is%20key%20to%20ensure%20that%20queries%20run%20in%20optimal%20fashion%20and%20return%20faster%20response%20-%3C%2FSPAN%3E%3CSPAN%20data-contrast%3D%22none%22%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fquery%2Fbest-practices%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EQuery%20best%20practices%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FSPAN%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335551550%26quot%3B%3A1%2C%26quot%3B335551620%26quot%3B%3A1%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335559739%26quot%3B%3A160%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%20aria-level%3D%223%22%3E%3CFONT%20size%3D%224%22%3E%3CSTRONG%3E%3CSPAN%20data-contrast%3D%22none%22%3EConsume%20Data%3A%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%20data-ccp-props%3D%22%7B%26quot%3B201341983%26quot%3B%3A0%2C%26quot%3B335551550%26quot%3B%3A1%2C%26quot%3B335551620%26quot%3B%3A1%2C%26quot%3B335559738%26quot%3B%3A40%2C%26quot%3B335559739%26quot%3B%3A0%2C%26quot%3B335559740%26quot%3B%3A259%7D%22%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20data-contrast%3D%22none%22%3EAzure%20Data%20Explorer%20API's%20provides%20wide%20variety%20of%20options%20where%20end%20users%20can%20query%20data%20based%20on%20requirements%20to%20be%20displayed%20in%20the%20application%20-%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-explorer%2Fkusto%2Fapi%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Data%20Explorer%20API%20Overview%20-%20Azure%20Data%20Explorer%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-3262996%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22TextRun%20SCXW71584403%20BCX8%22%20data-contrast%3D%22none%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3EIn%20many%20cases%20Azure%20Data%20Explorer%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E%E2%80%99s%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E%20inbuilt%20query%20capabilities%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecan%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ereduce%20the%20need%20to%20provision%20traditional%20memory%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecaching%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Eor%20other%20data%20sources%20which%20can%20increase%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ethe%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecost%20and%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Ecomplexities%3C%2FSPAN%3E%26nbsp%3B%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Einvolved%20to%20synchronize%20and%20maintain%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Efresh%20%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3Edata%3C%2FSPAN%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW71584403%20BCX8%22%3E.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E
Co-Authors
Version history
Last update:
‎Apr 04 2022 11:26 PM
Updated by: