You are designing a globally distributed social app that stores user timelines and comments as JSON documents. Users must see their own writes immediately, while cross-region latency must remain low. Writes are evenly distributed by user. What Cosmos DB design should you choose?
Choose an answer
Tap an option to check your answer.
Correct answer: Azure Cosmos DB SQL (Core) API with Session consistency and a partition key of userId.
Why this is the answer
The correct choice is Azure Cosmos DB SQL (Core) API with Session consistency and a partition key of userId. The SQL (Core) API is ideal for JSON document storage. Session consistency guarantees that a client will always read its own writes, which is crucial for a social app where users expect to see their updates immediately. This consistency level also offers good performance and low latency, especially when compared to Strong consistency, which would incur higher latency for cross-region writes. Partitioning by userId ensures even distribution of writes, preventing hot partitions, as writes are evenly distributed by user. Azure Cosmos DB for MongoDB with Strong consistency would have higher cross-region write latency. Azure Table Storage lacks the rich query capabilities for JSON documents and Eventual consistency doesn't guarantee read-your-own-writes. Strong consistency with a timestamp partition key would lead to hot partitions and high latency. The Gremlin API is for graph databases, not JSON documents, and Consistent Prefix doesn't guarantee read-your-own-writes.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed