Microsoft Azure Data FundamentalsDescribe how to work with non-relational data on AzureMedium

A company is developing a new social media application that needs to store highly interconnected user data, including friendships, likes, and comments. The application frequently performs complex traversals to find relationships between users, such as 'friends of friends' or 'users who liked a specific post and are also friends with another user'. Which Azure Cosmos DB API is most appropriate for this scenario?

  1. AAzure Cosmos DB for MongoDB API
  2. BAzure Cosmos DB for NoSQL (Core) API
  3. CAzure Cosmos DB for Gremlin (Graph) API
  4. DAzure Cosmos DB for Cassandra API
Show answer & explanation

Correct answer: C. Azure Cosmos DB for Gremlin (Graph) API

The Gremlin (Graph) API in Azure Cosmos DB is specifically designed for graph databases, which excel at storing and querying highly interconnected data. Its native support for graph traversals makes it ideal for social media applications that need to find relationships like 'friends of friends' efficiently.

Why the other options are wrong

  • A. The MongoDB API is for document data and is not optimized for graph-based relationship queries.
  • B. The NoSQL (Core) API is for document data and is less efficient for complex, deeply connected graph traversals.
  • D. The Cassandra API is for wide-column data and is not suitable for graph-based relationship queries.

Azure Cosmos DB Gremlin (Graph) API

An API in Azure Cosmos DB that enables users to store and query highly interconnected data using the Apache TinkerPop Gremlin graph traversal language.

  • Ideal for social networks, recommendation engines.
  • Efficiently queries relationships between entities.
  • Uses vertices (nodes) and edges (relationships).

Memory trick: Gremlin for graphs, SQL for JSON, Mongo for docs.

More Describe how to work with non-relational data on Azure questions