Microsoft Azure Data FundamentalsDescribe core data conceptsHard
A data architect is designing a system for a social media platform that needs to efficiently store and query complex relationships between users, posts, and comments. The platform frequently performs queries such as 'find all friends of friends who liked a specific post' or 'identify common interests among users connected to a particular group'. Which data model is MOST suitable for this scenario?
- ADocument
- BRelational
- CKey-Value
- DGraph
Show answer & explanationAnswer & explanation
Correct answer: D. Graph
The Graph data model is specifically designed to represent and query highly interconnected data, making it ideal for social media platforms where relationships between entities (users, posts, comments) are central to the application's functionality.
Why the other options are wrong
- A. Document databases are for flexible documents, not optimized for querying relationships between separate documents.
- B. Relational databases struggle with complex, many-to-many relationships, leading to performance issues with deep joins.
- C. Key-Value databases are for simple lookups, not for traversing complex networks of relationships.
Graph Data Model
A NoSQL data model that represents data as nodes (entities) and edges (relationships between entities). It is optimized for storing and querying highly connected data.
- Nodes represent entities (e.g., user, post).
- Edges represent relationships (e.g., 'follows', 'likes').
- Ideal for social networks, recommendation engines, fraud detection.
- Examples include Neo4j, Azure Cosmos DB's Gremlin API.
Memory trick: Graphs show how everything is 'connected'!