Microsoft Azure Data FundamentalsDescribe core data conceptsMedium
A global e-commerce company needs to store customer reviews, product descriptions, and order details. These data types are often semi-structured, with varying fields and nested structures, and the company requires flexibility to add new attributes without rigid schema changes. Which data model is MOST appropriate for this scenario?
- AColumn-family
- BGraph
- CRelational
- DDocument
Show answer & explanationAnswer & explanation
Correct answer: D. Document
The Document data model is ideal for semi-structured data with varying fields and nested structures, offering the schema flexibility required by the e-commerce company for customer reviews, product descriptions, and order details.
Why the other options are wrong
- A. Column-family models are optimized for wide tables with many attributes, but less intuitive for nested, document-like structures.
- B. Graph models are for interconnected data, not primarily for flexible semi-structured documents.
- C. Relational models are rigid and require predefined schemas, making them unsuitable for varying fields.
Document Data Model
A NoSQL data model that stores data in flexible, semi-structured documents, often in formats like JSON or XML. Each document is a self-contained unit.
- Offers schema flexibility, allowing documents to have different fields.
- Supports nested data structures.
- Ideal for catalogs, user profiles, and content management.
- Commonly used in Document Databases like MongoDB or Azure Cosmos DB's Document API.
Memory trick: Documents are like flexible folders, holding whatever you put inside.