A social media application stores user profiles as JSON documents. Each user profile can have different attributes (e.g., some have 'education', others have 'work experience'). The application needs to query profiles by any attribute with low latency. Which Azure data store is most appropriate?
Cosmos DB SQL API natively supports JSON documents with flexible schemas and provides indexing on all properties for fast queries.
Why this answer
Azure Cosmos DB with the SQL API is the correct choice because it natively supports schema-agnostic JSON documents, allowing each user profile to have varying attributes without requiring a fixed schema. Its indexing policies enable low-latency queries on any attribute, and it provides single-digit millisecond response times for point reads and queries, which is essential for a social media application.
Exam trap
The trap here is that candidates often confuse Azure Table Storage's key-value model with a document database, assuming it can query arbitrary attributes efficiently, but Table Storage requires a composite key and lacks secondary indexes for ad-hoc queries on non-key fields.
How to eliminate wrong answers
Option A is wrong because Azure Blob Storage is designed for unstructured binary or text data (like images or videos) and does not support querying individual attributes within JSON documents; it would require loading entire blobs and parsing them client-side. Option B is wrong because Azure Table Storage is a key-value store that requires a predefined partition key and row key, and it does not support querying on arbitrary attributes without scanning all entities, leading to higher latency. Option D is wrong because Azure SQL Database is a relational database that requires a fixed schema, so storing user profiles with varying attributes would necessitate complex schema designs (e.g., EAV pattern) or frequent ALTER TABLE operations, which adds overhead and reduces query performance.