CompTIA Data+ (DA0-002)Data Concepts and EnvironmentsMedium
A data engineer needs to store configuration settings for a distributed microservices architecture. Each service's configuration is a complex, hierarchical structure that can vary significantly between services and may evolve over time without requiring strict schema enforcement. The primary operations will be reading and updating entire configuration documents. Which database type is BEST suited for this scenario?
- AColumnar Database
- BKey-Value Store
- CRelational Database
- DDocument Database
Show answer & explanationAnswer & explanation
Correct answer: D. Document Database
Document databases are ideal for storing semi-structured, hierarchical data like JSON or XML documents. Their schema-less nature allows for flexible configurations that can evolve, and they are optimized for retrieving and updating entire documents, which fits the 'entire configuration documents' requirement.
Why the other options are wrong
- A. Columnar databases are optimized for analytical queries over specific columns, not for storing and retrieving entire flexible documents.
- B. Key-value stores are too simple for complex, hierarchical structures, typically storing flat values.
- C. Relational databases would require a fixed schema, making complex, evolving configurations difficult to manage.
Document Database
A NoSQL database that stores data in flexible, semi-structured formats (like JSON, BSON, XML) called documents. It offers schema flexibility and is good for hierarchical data.
- Stores data as documents, often JSON-like.
- Schema-flexible, allowing documents to have different structures.
- Optimized for retrieving and updating entire documents.
Memory trick: Documents are flexible, relational is rigid, columnar is vertical, key-value is simple.