Sessions Objectives Azure Cosmos DB Core SQL API
Session’s Objectives
Azure Cosmos DB Core (SQL) API Table API Column-family Mongo. DB Document Graph Key-value Elastic scale out of storage & throughput Turnkey global distribution Guaranteed low latency at the 99 th percentile Five well-defined consistency models Comprehensive SLAs
Use Case: Building an Enterprise Time Tracking Platform
Determining Throughput (RUs)
Steps to determine required throughput
Calculating required throughput Workload is in the ratio of 2: 1 Reads vs. Writes Graph: Max consumed RUs per partition key range Pop Quiz: What should be throughput in RUs per partition?
Analyzing expensive queries Request Units consumed by this query == Peak: 959 RUs & Average: 50 RUs 21 GB of data in the collection and increasing
Partitioning
Identifying the partition key Storage Distribution Uniformity Cardinality Or Uniqueness Of Value Distinctness at any given time (sec) submitted. By High submitted. Date Low High Low assigned. Approver High Low Partition Key: submitted. By
Routing queries via partition key Partition Key = submitted. By
Cross-partition queries Partition Key = submitted. By
Partitioning on Submitted. By Operation Type Document Write RU Consumption Operations/second Total RUs Consumed/second 5 10 writes / second 50 RUs 50 100 queries / second 5000 RUs 1 500 queries / second 500 RUs
Change Feed Partition Key = assigned. Approver. Collection assigned. Approver
Using the Change Feed to duplicate data RU Consumption Operations/second Total RUs Consumed/second Document Write into Collection partitioned on submitted. By 5 10 writes / second 50 RUs Read Document from Change Feed 1 10 reads / second 10 RUs Document Write into Collection partitioned on assigned. Approver 5 10 writes / second 50 RUs 1 100 queries / second 100 RUs 1 500 queries / second 500 RUs Operation Type
Remember the Pop Quiz? Workload is in the ratio of 2: 1 Reads vs. Writes Graph: Max consumed RUs per partition key range Pop Quiz: What should be throughput in RUs per partition?
Consistency Level
Right trade-off between consistency and performance WEST US Partition Key: Submitted. By SEVERAL Cosmos DB Collection (Time Collection) REQUIREMENTS POC RESULTS • • We cannot deploy READ regions outside US due to violation of the constraint of having READ region within 5 K miles of the nearest WRITE region High response times
Right trade-off between consistency and performance WEST US Partition Key: Submitted. By SEVERAL Cosmos DB Collection (Time Collection) REQUIREMENTS POC RESULTS • • Does not guarantee that a user will be able to see the last updated time entry record Repeated re-submission of time entry and inconsistent data
Right trade-off between consistency and performance WEST US Partition Key: Submitted. By SEVERAL Cosmos DB Collection (Time Collection) REQUIREMENTS POC RESULTS • • When accessed through the same client, system guarantees reading the latest write of the time entry record End-users are consistently routed to the nearest compute and hence within the scope of a transaction there were no stale reads of the time entry record
Right trade-off between consistency and performance WEST US Partition Key: Submitted. By SEVERAL Cosmos DB Collection (Time Collection) REQUIREMENTS POC RESULTS • • • Workload in our application is in the ratio of 2: 1 Reads vs. Writes Approver might not be able to see the submissions after a predictable time Application cannot operate with eventual consistency, since there are no latency guarantees
Right trade-off between consistency and performance WEST US Partition Key: Submitted. By SEVERAL Cosmos DB Collection (Time Collection) REQUIREMENTS POC RESULTS • Best effort replication of data and hence not suitable
Right trade-off between consistency and performance WEST US Partition Key: Submitted. By SEVERAL Cosmos DB Collection (Time Collection) REQUIREMENTS POC RESULTS • • When accessed through the same client, system guarantees reading the latest write of the time entry record End-users are consistently routed to the nearest compute and hence within the scope of a transaction there were no stale reads of the time entry record
Metrics and SLAs
Metrics and SLAs 27000 # of unique users entering time per day <2 s Response time for time entry at 95 th percentile <10 ms 99. 999% 50%+ Latency at 99 th Percentile Availability of the time entry service Cost Savings by leveraging Cosmos DB
Demo
Resources on Azure Cosmos DB aka. ms/Practical. Cosmos. Db cosmosdb. com gotcosmos. com
Stop by our booth to meet the experts who build, deploy, and operate the systems that run Microsoft Look for: How Microsoft transforms IT in the Microsoft Showcase (right next to the Security VR Escape room)
Attend our sessions and learn proven practices from your IT pro peers at Microsoft We’ll share the inside view of how Microsoft builds, deploys, and operates the systems that run Microsoft. aka. ms/CSEOat. Ignite 2019
Learn how Core Services Engineering and Operations (CSEO) is leading the internal transformation of Microsoft by rethinking traditional IT Read the new white paper by Chief Digital Officer, Kurt Del. Bene aka. ms/Microsoft. Internal. DT
Please evaluate this session Your feedback is important to us! https: //aka. ms/ignite. mobileapp https: //myignite. techcommunity. microsoft. com/evaluations
Find this session in Microsoft Tech Community
- Slides: 34