Azure Cosmos DB Gremlin API for Social Network Relationships
A social networking application needs to store and query relationships between users, such as 'friends of friends'. The application should be able to traverse these relationships efficiently to recommend new connections. Which Azure NoSQL data store and API should they choose?
Quick Answer
The correct choice is Azure Cosmos DB with the Gremlin API because Gremlin is a graph traversal language purpose-built for navigating highly connected data, such as social network relationships. It enables efficient traversal of edges between vertices, allowing queries like 'friends of friends' to be executed using graph algorithms that follow relationship paths directly, rather than relying on expensive JOIN operations. On the DP-900 exam, this scenario tests your understanding of which Azure NoSQL service maps to specific data models—graph data demands a graph database, not a document or key-value store. A common trap is choosing the Table API or SQL API, which lack native edge traversal capabilities. Remember the mnemonic: "Graphs need Gremlin" to instantly link social networks with the Gremlin API.
⚠ Common exam trap
Candidates often confuse the Table API (which is also NoSQL) as suitable for relationships, but it cannot perform multi-hop graph traversals, while Azure Cache for Redis might seem plausible due to its set operations, but it lacks a graph query language and persistence guarantees.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Azure Cosmos DB with the Gremlin API
Azure Cosmos DB with the Gremlin API is the correct choice because Gremlin is a graph traversal language specifically designed for querying highly connected data, such as social network relationships. It allows efficient traversal of edges (e.g., 'friends of friends') using graph algorithms, which is exactly what the application needs for recommending new connections. Other APIs like Table API or services like Blob Storage lack native graph traversal capabilities.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Azure Cosmos DB with the Gremlin API
Why this is correct
Cosmos DB's Gremlin API stores data as vertices and edges, so traversals such as friends-of-friends execute as native graph operations rather than recursive joins. This satisfies the efficient relationship-traversal requirement for recommending new connections, unlike key-value or document APIs.
- ✗
Azure Cosmos DB with the Table API
Why it's wrong here
The Table API stores key-attribute entities without graph traversal, so friends-of-friends queries need repeated lookups rather than native edge hops. It suits high-volume key-value workloads; the Gremlin API models vertices and edges for relationship traversal.
When this WOULD be correct
An application requires storing large amounts of non-relational structured data (e.g., user profiles, device telemetry) with simple key-based lookups or queries on partition/row keys, and does not need complex relationship traversal.
- ✗
Azure Cache for Redis
Why it's wrong here
Redis is an in-memory cache, not a durable graph store, and offers no edge traversal primitives for friends-of-friends queries. It suits session state and sub-millisecond caching; the Gremlin API persists vertices and edges for relationship queries.
When this WOULD be correct
A question requiring a high-performance, low-latency cache for frequently accessed data, such as session state or real-time leaderboards, where the primary need is speed and not complex querying or persistence.
- ✗
Azure Blob Storage
Why it's wrong here
Blob Storage holds unstructured objects in flat containers, providing no query language or relationship traversal. It suits storing images, logs and backups; the Gremlin API represents users as vertices and friendships as edges for efficient multi-hop queries.
When this WOULD be correct
A question asking for storing and serving large binary files (e.g., user profile pictures, videos) with high scalability and low cost, where no complex querying is needed.
Option-by-option analysis
Why each answer is right or wrong
Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The DP-900 exam frequently reuses these exact scenarios with slightly different constraints.
✓Azure Cosmos DB with the Gremlin APICorrect answer▾
Why this is correct
Cosmos DB's Gremlin API stores data as vertices and edges, so traversals such as friends-of-friends execute as native graph operations rather than recursive joins. This satisfies the efficient relationship-traversal requirement for recommending new connections, unlike key-value or document APIs.
✗Azure Cosmos DB with the Table APIWrong answer — click to see why▾
Why this is wrong here
The Table API provides key-value and tabular data storage with limited query capabilities, lacking native graph traversal and relationship querying needed for 'friends of friends' scenarios.
★ When this WOULD be the correct answer
An application requires storing large amounts of non-relational structured data (e.g., user profiles, device telemetry) with simple key-based lookups or queries on partition/row keys, and does not need complex relationship traversal.
Why candidates choose this
Candidates may confuse Table API's ability to store semi-structured data with graph capabilities, or assume any NoSQL store can handle relationships, overlooking the specialized graph model required.
✗Azure Cache for RedisWrong answer — click to see why▾
Why this is wrong here
Azure Cache for Redis is an in-memory cache, not a NoSQL data store optimized for graph traversal. It lacks native graph query capabilities like Gremlin, making it inefficient for 'friends of friends' relationship queries.
★ When this WOULD be the correct answer
A question requiring a high-performance, low-latency cache for frequently accessed data, such as session state or real-time leaderboards, where the primary need is speed and not complex querying or persistence.
Why candidates choose this
Candidates may confuse Redis's ability to store simple key-value pairs with graph data structures, or assume its speed makes it suitable for any fast data access scenario, overlooking the need for graph-specific traversal operations.
✗Azure Blob StorageWrong answer — click to see why▾
Why this is wrong here
Azure Blob Storage is an object store for unstructured data like images and videos, not for graph relationships. It lacks query capabilities for traversing 'friends of friends' relationships.
★ When this WOULD be the correct answer
A question asking for storing and serving large binary files (e.g., user profile pictures, videos) with high scalability and low cost, where no complex querying is needed.
Why candidates choose this
Candidates might think Blob Storage can store any data, including relationship data, and overlook the need for graph traversal queries.
Analysis generated from the official DP-900blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”
Go deeper
Related to this question
Learn chapter
Cosmos DB Partitioning Strategies
Key term
Table
A table is a structured collection of data organized into rows and columns, used in databases and spreadsheets to store and manage information efficiently.
Key term
Blob storage
Blob storage is a cloud service for storing large amounts of unstructured data, such as text or binary data, like documents, images, and videos.
About these practice questions
One of 851 original DP-900 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on DP-900
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A social networking application needs to store and query relationships between users, such as 'friends of friends' to recommend new connections. The application must traverse these relationships efficiently. Which Azure NoSQL data store and API should they choose?
medium- A.Azure Cosmos DB with MongoDB API
- ✓ B.Azure Cosmos DB with Gremlin API
- C.Azure Table Storage
- D.Azure Cosmos DB with SQL API
Why B: Azure Cosmos DB with Gremlin API is correct because it provides a graph database model specifically designed for storing and querying highly connected data, such as user relationships. The Gremlin API supports graph traversal queries (e.g., 'friends of friends') natively using the Apache TinkerPop graph traversal language, enabling efficient navigation of edges and vertices without expensive join operations.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DP-900 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-900 exam.