Azure Cosmos DB
Udaiappa Ramachandran ( Udai )
https://udai.io
About me
• Udaiappa Ramachandran ( Udai )
• CTO-Akumina, Inc.
• Microsoft Azure MVP
• Cloud Expert
• Microsoft Azure, Amazon Web Services, and Google
• New Hampshire Cloud User Group (http://www.meetup.com/nashuaug )
• https://udai.io
Agenda
• Intro to SQL API
• SQL API SDK
• Partition and Indexes
• Data movement
• Change Feed
• Integration (Azure Functions and Search)
• Consistency Models
• Replication and Multi-write
• Cosmos DB Emulator
• Demo…Demo…Demo…
Introduction
• No SQL Feature(s)
• High Volume of data
• Non relational
• Data from many different sources and forms
• Dynamic data schema to store different types of data
• High velocity and real time data
• Designed for scale-out
• Cosmos DB is a Platform as a service for the following No SQL Databases
• SQL API (Document DB) – JSON Document (Sql Queries)
• MongoDB – BSON Document (MondoDB queries)
• Gremlin – Graph (vertices and Edges)
• Cassandra – Columnar (Schema)
• Table API – Key Value (Azure Table Storage)
Cosmos DB SQL API
• Fast NoSQL database
• Globally distributed
• Guaranteed speed at any scale
• Single digit milliseconds response time
• Ready for mission-critical applications (99.999)
• Fully managed and cost-effective serverless database
Database, Containers and Items
• Indexing
• Data Types
• Time to live
• Transactions and
optimistic
• Concurrency
control
Throughput
• Measured as Request Units (RUs)
• Assigned at Database or Container level
• Standard
• AutoScale
• Serverless
Partitions
• Logical partitions
• Physical partitions
• Choosing partition key
• Synthetic partition key
Data Movement
• Kafka Connector
• Stream Analytics
• Spark Connector
• Azure Data Factory
Consistency Model
• Bounded Staleness
• Consistent Prefix
• Eventual
• Session
• Strong
Change Feed
• Reading change feed
• Change feed processor
• Trigger Azure Functions
Integration with Functions/Cognitive Search
• Bind Cosmos DB using Change Feed
• Run FullText index using Cognitive Search
.NET SDK
• Client-Side (SDK)
• Working with Databases, Containers, Documents
• Bulk insert
• Transaction support
• Stateful and Stateless paging
• Server-Side
• Stored Procedure
• User-defined Functions
• Triggers
• Bulk insert using Stored Procedure
Multi-Region Write
• Sliding scale of well-defined consistency models (strong consistency is not
supported)
• Low latency write operations across the globe
• High availability with financially backed SLA
• Multi-region support in the SDK
• Conflict resolution policy (built-in and custom)
• insert, replace, delete
Replication & Failover
• Distribute data across global data centers
• Automatic failover and manual failover
• Configure region in SDK
Cosmos DB Emulator
• Run cosmos DB locally
• Runs on Windows, Linux or Container
Response Status Code & Headers
• HTTP Status Codes for Azure Cosmos DB | Microsoft Docs
• Common response headers - Azure Cosmos DB REST API | Microsoft Docs
Reference
• Introduction to Azure Cosmos DB | Microsoft Docs
• Complete Training Video: https://docs.microsoft.com/en-us/events/learn-
events/learnlive-azure-cosmos-db-certification-study-hall/?WT.mc_id=AZ-
MVP-5004665
• Azure Cosmos DB Capacity Calculator
• Demo Samples: https://github.com/nhcloud/techtalk

CosmosDB.pptx

  • 1.
    Azure Cosmos DB UdaiappaRamachandran ( Udai ) https://udai.io
  • 2.
    About me • UdaiappaRamachandran ( Udai ) • CTO-Akumina, Inc. • Microsoft Azure MVP • Cloud Expert • Microsoft Azure, Amazon Web Services, and Google • New Hampshire Cloud User Group (http://www.meetup.com/nashuaug ) • https://udai.io
  • 3.
    Agenda • Intro toSQL API • SQL API SDK • Partition and Indexes • Data movement • Change Feed • Integration (Azure Functions and Search) • Consistency Models • Replication and Multi-write • Cosmos DB Emulator • Demo…Demo…Demo…
  • 4.
    Introduction • No SQLFeature(s) • High Volume of data • Non relational • Data from many different sources and forms • Dynamic data schema to store different types of data • High velocity and real time data • Designed for scale-out • Cosmos DB is a Platform as a service for the following No SQL Databases • SQL API (Document DB) – JSON Document (Sql Queries) • MongoDB – BSON Document (MondoDB queries) • Gremlin – Graph (vertices and Edges) • Cassandra – Columnar (Schema) • Table API – Key Value (Azure Table Storage)
  • 5.
    Cosmos DB SQLAPI • Fast NoSQL database • Globally distributed • Guaranteed speed at any scale • Single digit milliseconds response time • Ready for mission-critical applications (99.999) • Fully managed and cost-effective serverless database
  • 6.
    Database, Containers andItems • Indexing • Data Types • Time to live • Transactions and optimistic • Concurrency control
  • 7.
    Throughput • Measured asRequest Units (RUs) • Assigned at Database or Container level • Standard • AutoScale • Serverless
  • 8.
    Partitions • Logical partitions •Physical partitions • Choosing partition key • Synthetic partition key
  • 9.
    Data Movement • KafkaConnector • Stream Analytics • Spark Connector • Azure Data Factory
  • 10.
    Consistency Model • BoundedStaleness • Consistent Prefix • Eventual • Session • Strong
  • 11.
    Change Feed • Readingchange feed • Change feed processor • Trigger Azure Functions
  • 12.
    Integration with Functions/CognitiveSearch • Bind Cosmos DB using Change Feed • Run FullText index using Cognitive Search
  • 13.
    .NET SDK • Client-Side(SDK) • Working with Databases, Containers, Documents • Bulk insert • Transaction support • Stateful and Stateless paging • Server-Side • Stored Procedure • User-defined Functions • Triggers • Bulk insert using Stored Procedure
  • 14.
    Multi-Region Write • Slidingscale of well-defined consistency models (strong consistency is not supported) • Low latency write operations across the globe • High availability with financially backed SLA • Multi-region support in the SDK • Conflict resolution policy (built-in and custom) • insert, replace, delete
  • 15.
    Replication & Failover •Distribute data across global data centers • Automatic failover and manual failover • Configure region in SDK
  • 16.
    Cosmos DB Emulator •Run cosmos DB locally • Runs on Windows, Linux or Container
  • 17.
    Response Status Code& Headers • HTTP Status Codes for Azure Cosmos DB | Microsoft Docs • Common response headers - Azure Cosmos DB REST API | Microsoft Docs
  • 18.
    Reference • Introduction toAzure Cosmos DB | Microsoft Docs • Complete Training Video: https://docs.microsoft.com/en-us/events/learn- events/learnlive-azure-cosmos-db-certification-study-hall/?WT.mc_id=AZ- MVP-5004665 • Azure Cosmos DB Capacity Calculator • Demo Samples: https://github.com/nhcloud/techtalk

Editor's Notes

  • #5 Horizontal partitioning Automatic Indexing Provisioned Throughput
  • #6  IoT device telemetetry personalization and recommendations Global, mission-critical multi-region write replication and manage failovers distribute data across global data centers Automatic failover and manual failover Configure region in SDK multi-write sliding scale of weel-defined consistency models (strong consistency is not supported) low latency write operations acroos the globe High availability with finacially backed SLA multi-region support in the SDK conflict resolution policy (built-in and custom) --insert, replace, delete throughput standard autoscale serverless SDK .net(C#) java, python, JavaScript (Node.js) integrate the Microsoft.Azure.Cosmos SDK library from NuGet (.CosmosClient, .Database, .Container) Connect to an Azure Cosmos DB SQL API account using the SDK and .NET consistency bounded staleness consistentprefix eventual session strong data movement kafka connector 1way stream analytics 1way spark connector /synapse link 2way azure data factory--etl 2way cosmicwork tool log handler (requesthandler), queryrequestoptions-maxconcurren (||sm)
  • #8  IoT device telemetetry personalization and recommendations Global, mission-critical multi-region write replication and manage failovers distribute data across global data centers Automatic failover and manual failover Configure region in SDK multi-write sliding scale of weel-defined consistency models (strong consistency is not supported) low latency write operations acroos the globe High availability with finacially backed SLA multi-region support in the SDK conflict resolution policy (built-in and custom) --insert, replace, delete throughput standard autoscale serverless SDK .net(C#) java, python, JavaScript (Node.js) integrate the Microsoft.Azure.Cosmos SDK library from NuGet (.CosmosClient, .Database, .Container) Connect to an Azure Cosmos DB SQL API account using the SDK and .NET consistency bounded staleness consistentprefix eventual session strong data movement kafka connector 1way stream analytics 1way spark connector /synapse link 2way azure data factory--etl 2way cosmicwork tool log handler (requesthandler), queryrequestoptions-maxconcurren (||sm)
  • #9  IoT device telemetetry personalization and recommendations Global, mission-critical multi-region write replication and manage failovers distribute data across global data centers Automatic failover and manual failover Configure region in SDK multi-write sliding scale of weel-defined consistency models (strong consistency is not supported) low latency write operations acroos the globe High availability with finacially backed SLA multi-region support in the SDK conflict resolution policy (built-in and custom) --insert, replace, delete throughput standard autoscale serverless SDK .net(C#) java, python, JavaScript (Node.js) integrate the Microsoft.Azure.Cosmos SDK library from NuGet (.CosmosClient, .Database, .Container) Connect to an Azure Cosmos DB SQL API account using the SDK and .NET consistency bounded staleness consistentprefix eventual session strong data movement kafka connector 1way stream analytics 1way spark connector /synapse link 2way azure data factory--etl 2way cosmicwork tool log handler (requesthandler), queryrequestoptions-maxconcurren (||sm)
  • #10 Kafka Connector 1way Stream Analytics 1way Spark Connector /synapse link 2way Azure Data Factory--ETL 2way
  • #11 https://docs.microsoft.com/en-us/azure/cosmos-db/consistency-levels