Data Modeling medium
In DynamoDB/Cassandra, what happens if you choose a Partition Key with low cardinality (e.g., `Gender` or `Status`)?
- A It significantly improves the database's ability to perform localized range-scanning and accelerates all categoric report generation.
- B It optimizes the physical disk storage footprint by allowing the database engine to group similar values into a single compressed block.
- C It enables the system to maintain a higher degree of availability during massive network partitions by reducing the gossip-protocol overhead.
- D It causes Hot Partitions, where a disproportionate amount of data clumps onto a few physical nodes, leading to throttling and bottlenecks.
Answer: D. It causes Hot Partitions, where a disproportionate amount of data clumps onto a few physical nodes, leading to throttling and bottlenecks.
Modern NoSQL databases rely on the 'Partition Key' (or Shard Key) to distribute data across many machines using a hashing algorithm. If a key has low cardinality (e.g., using `Gender` or `Current_Status` as the key), all data will hash into only a handful of buckets. This limits the cluster's effective throughput to the speed of those specific nodes, effectively neutralizing the benefits of horizontal scaling.
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)?