Data Modeling medium
In Wide-Column stores like Cassandra, why is the data model designed distinctively 'Query-First'?
- A Because Wide-Column stores are designed to support arbitrary, ad-hoc SQL joins and complex subqueries that are dynamically optimized at execution time.
- B Because they lack efficient internal JOIN support, forcing developers to design tables that precisely mirror their application-level read patterns.
- C Because the underlying storage engine is exceptionally sensitive to data redundancy, requiring a strictly normalized schema to minimize physical hardware costs.
- D Because the database automatically manages all secondary indexing and range-scanning optimizations through a centralized, high-speed coordination master.
Answer: B. Because they lack efficient internal JOIN support, forcing developers to design tables that precisely mirror their application-level read patterns.
In relational modeling (SQL), you normalize first and optimize queries later. In distributed Wide-Column stores like Cassandra, you must invert this: you define your exact query patterns first and create tables specifically tailored to fulfill them (e.g., creating both `Users_By_Email` and `Users_By_ID`). This 'denormalized' approach guarantees predictable, linear read scalability across massive datasets by avoiding the non-linear cost of distributed joins.
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)?