A mobile game company stores player profiles and game state in Azure Cosmos DB. Each document contains playerId, level, score, inventory (an array of items), and lastLogin. The application requires fast point reads by playerId, queries to find all players within a specific score range, and global distribution with multi-region writes for low latency worldwide. They also want to use a familiar SQL-like query language. Which Azure Cosmos DB API should they choose?
The Core (SQL) API supports SQL-like queries, point reads by playerId, range queries on score, and multi-region writes with global distribution. It satisfies every constraint in the stem, unlike the API-specific alternatives that lack SQL querying or multi-region write support.
Why this answer
The Core (SQL) API is the correct choice because it provides native support for SQL-like queries, enabling the required point reads by playerId and range queries on score. It also offers multi-region writes for global distribution with low latency, which aligns with the application's need for worldwide player access. The document model with arrays (inventory) is directly supported, making it ideal for storing player profiles and game state.
Exam trap
The trap here is that candidates often confuse the MongoDB API's use of a familiar query language (MongoDB's own) with SQL-like syntax, or assume that any NoSQL API can handle range queries equally, but the Core (SQL) API is the only one that provides native SQL-like querying with automatic indexing for such patterns.
Why the other options are wrong
The MongoDB API does not support multi-region writes with a SQL-like query language; it uses MongoDB's query syntax. The question requires SQL-like queries and global distribution with multi-region writes, which the Core (SQL) API provides natively.
The Cassandra API does not support SQL-like queries or multi-region writes with low latency; it uses CQL (Cassandra Query Language) and is optimized for high-throughput writes but not for global distribution with multi-region writes.
The Gremlin API is designed for graph databases and querying relationships between entities, not for document-based queries like point reads by playerId or score range queries. It does not support SQL-like query language.