Data Modeling and Partitioning in Azure Cosmos DB
summary
Migrates an AdventureWorks subset into Azure Cosmos DB, showing embedding customer address/password cuts a three-query cost (~17 RU) to a single 2.83 RU request and using a point read 1 RU when id+partition key are known. Chooses partition keys by access patterns (categoryId for products, customerId for customers+orders), uses change feed to propagate renames (category/tag → product documents), and uses transactional batch to atomically create orders and increment salesOrderCount so a top‑10 customers query can run efficiently. Limits: 2 MB doc, 20 GB logical partition.
AI-written summary · about
chapters (26)
- 0:00Start
- 3:39Is Cosmos Even Suitable for Relational Workload
- 4:41Product Tables
- 5:47Access Patterns
- 8:18Reading Data
- 10:19Customer Password
- 16:07Logical Partition
- 16:36Partition Key
- 17:17Constraints
- 21:23Cross-Partition Query
- 24:18Demo
- 27:31Point Read
- 32:33Product Tags
- 37:45Query Product by Category Id
- 40:13Create Products for Category
- 40:36Update the Product Category
- 41:13Change Feed
- 42:44Update Product Category Name
- 49:27Query Top 10 Customers Based upon the Number of Sales Orders
- 50:52Transactional Batch
- 54:39Create a New Order
- 55:13Transaction Batch
- 57:52Final Design
- 58:18Key Takeaways
- 1:00:22Podcast
- 1:01:34What's the Difference between Cosmos and Dynamodb
related talks
52mPerformance tuning for Azure Cosmos DB
48mPerformance tuning for Azure Cosmos DB
01h 00mCost cutting strategies for Azure Cosmos DB
49mSQL Server vs Azure Cosmos DB
46mDesign and build multi-tenant SaaS apps at scale with Azure Cosmos DB
08mOptimize for the Best Cost and Performance for Azure Cosmos DB NoSQL API
25mAzure Cosmos DB Modeling Methodology
14mHow to achieve good cost/performance with Azure Cosmos DB elasticity
