Data Modeling easy
Which scenario is often better suited for a NoSQL (Document) database like MongoDB rather than a connectional SQL DB?
- A A mission-critical financial ledger system that requires strict, multi-row ACID transactions and absolute mathematical consistency.
- B A small, internal administrative tool with a rigid and predictable data schema that is guaranteed to remain stable for several years.
- C A complex business intelligence reporting tool that requires the merging of dozens of normalized tables through deep JOIN operations.
- D A dynamic product catalog where items have highly varied attributes (polymorphic data) and the schema requires frequent, rapid evolution.
Answer: D. A dynamic product catalog where items have highly varied attributes (polymorphic data) and the schema requires frequent, rapid evolution.
Document-oriented NoSQL databases are ideal for 'sparse' or evolutionary data. In a product catalog, a 'Laptop' might have a screen size, while a 'Book' has an ISBN. In a relational database, this often results in many NULL columns or complex Entity-Attribute-Value (EAV) patterns. NoSQL handles this variety naturally at the cost of the strict referential integrity (Foreign Keys) found in SQL.
One system design question a day, with spaced repetition so the ones you miss come back.
Get the appRelated questions
- When modeling a Distributed Transaction using the Saga Pattern (Choreography or Orchestration), what type of consistency do you achieve?
- Which practice prevents SQL Injection attacks?
- What is 'Bi-Temporal' data modeling (e.g., in SQL:2011 standard)?
- Adding an Index to a database column generally improves Read performance. What is the negative trade-off?
- Log Systems Merge (LSM) Trees (used in RocksDB, Cassandra) optimize for fast writes. What is their primary downside regarding Disk I/O?
- What is the primary objective of normalizing a relational database schema (e.g., to 3NF)?