Choose a Cosmos DB API and partition key
Match distributed application requirements with the data model, client API and access path.
One customer gets busy
A catalog partitions by country. Nearly all requests come from one country and target individual products. The team adds a region but write pressure persists. Which design assumption needs testing?
Operational use cases
Cosmos DB can serve operational records with low-latency access and configurable distribution. Model around frequent reads and writes, choose a partition key that spreads traffic and test consistency requirements. Global distribution does not remove a hot-key bottleneck.
Data models and APIs
The API determines client compatibility and the operations available. The NoSQL API handles JSON items, Gremlin expresses graph traversals and the Table API supports keyed entities. Evaluate MongoDB-compatible and Cassandra-compatible offerings against the client’s actual requirements. A SQL-like query language for JSON does not make the store a relational database.
Work through the decision
Compare your reasoning
Geography served to readers and how writes distribute across logical keys are different decisions. Analyze request concentration, consider a suitably distributed product or tenant key and test queries. A key good for point reads may trade off against category browsing.
Change one constraint
A second app asks for friends-of-friends paths with edge properties. What requirement guides API selection?
Check your answer
It needs a graph traversal model. Evaluate the Gremlin API against required operations. An API that supports document lookups may still be a poor match for traversal-heavy access.
Revisit the recording
The table and Cosmos DB section compares keyed, document and graph access, including Gremlin. Let the client’s actual queries guide API choice. Azure Tables Cosmos DB · 2:34:13.
The Cosmos DB walkthrough explores multiple client models. Test an actual point read or graph traversal instead of assuming similarly named APIs are interchangeable. Explore Cosmos DB various NoSQL engines · 3:57:36.
Sources and further practice
Microsoft exam objectives · Microsoft documentation for this case.
Match a database to the application’s access pattern · AWS Certified Cloud Practitioner · Return to the study map.
Choose a Cosmos DB API and partition key quiz
Answer 5 questions. Check each answer for an explanation.