Microsoft Azure Data FundamentalsDescribe core data conceptsMedium
A social networking platform needs to efficiently store and query complex relationships between users, such as friendships, likes, and shares. The queries often involve traversing multiple connections to find indirect relationships (e.g., 'friends of friends'). Which data model is most appropriate for this scenario?
- ADocument Data Model
- BGraph Data Model
- CRelational Data Model
- DKey-Value Data Model
Show answer & explanationAnswer & explanation
Correct answer: B. Graph Data Model
A graph data model is specifically designed to represent highly interconnected data and efficiently query relationships (edges) between entities (nodes), making it ideal for social networks where relationship traversal is key.
Why the other options are wrong
- A. Document models are good for flexible, semi-structured data but not optimized for complex relationship queries.
- C. Relational models can represent relationships but become complex and inefficient for multi-level relationship traversal.
- D. Key-value models are too simplistic for managing and querying complex, interconnected relationships.
Graph Data Model
A data model that represents data as nodes (entities) and edges (relationships) between them, optimized for relationship traversal.
- Data as nodes and edges
- Optimized for relationship queries
- Ideal for interconnected data like social networks
Memory trick: Think of a 'graph' of friends, connecting everyone.