Analyze Azure CosmosDB data using Azure Synapse Link and Transact-SQL language
Published Oct 16 2020 05:05 AM 6,183 Views
Microsoft

Azure Synapse Analytics workspace is advanced analytic solution that enables you to analyze various data sources in Azure cloud. Azure Synapse Link for Azure Cosmos DB connects Azure Synapse Analytics workspace with Azure CosmosDB analytical store (preview) that contains a copy of Cosmos DB data highly optimized for analytic workloads. With Azure Synapse Link for CosmosDB, you can run complex analytic and create reports on top data stored in Cosmos DB analytical store without impacting the main Cosmos DB transactional containers.

JovanPop_0-1602849396921.png

 

In addition to the languages available in Apache Spark in Azure Synapse Analytics, you can also use Transact-SQL language to analyze data in Cosmos DB analytical storeServerless Synapse SQL pool enables you to run T-SQL queries on top of your Cosmos DB analytical data.

Rich T-SQL surface enables a large ecosystem of tools and applications to directly query Cosmos DB analytical data. You can easily explore data in analytical store of CosmosDB container using T-SQL OPENROWSET function. 

JovanPop_1-1602849396940.png

 

OPENROWSET function represents a bridge between the analytical tools and globally distributed data stored in Azure Cosmos DB containers. You need to provide a connection string to your Cosmos DB account and specify container name that should be analyzed. The following example shows how to explore sample data from your Cosmos DB container:

 

SELECT TOP 10 *
FROM OPENROWSET (
    'CosmosDB', 
    'account=<CosmosDB account>;database=<database>;region=<region>;key=<CosmosDB key>',
    Product   
) AS products

 

 

You can create complex reports that join multiple containers, group by results, apply window aggregates, and perform any analytic and data transformation that you usually apply on classic SQL database data.

Azure Synapse Link for Azure Cosmos DB enables you to combine the power of a low latency, globally distributed NoSQL database with a powerful relational SQL analytics engine. This solution enables you to leverage cloud-native hybrid transactional and analytical processing (HTAP) capabilities to provide near real-time analytics solutions on Azure Cosmos DB data. The resources in your Azure CosmosDB transactional store are not affected by analytic queries and analytic query don’t spend any Azure CosmosDB resource units (RU). No- extract-transform-load (ETL) analytics against globally distributed operational data at scale enables business analysts and data engineers with T-SQL skills to run near real-time business intelligence and analytics without impacting the performance on the transactional workloads on Azure Cosmos DB.

 

In this video you can see Synapse SQL Link for Cosmos DB in action:

 

 

Find more information about querying Azure CosmosDB analytical store using T-SQL language in the article How to query Azure CosmosDB data using serverless Synapse SQL pool and Synapse Link for Cosmos DB.

2 Comments
Version history
Last update:
‎Oct 19 2020 07:43 AM
Updated by: