Recall & Review
beginner
What is a shard key in distributed databases?
A shard key is a specific field or set of fields used to divide data into smaller parts called shards. It helps distribute data across multiple servers to improve performance and scalability.
Click to reveal answer
beginner
Why is choosing the right shard key important?
The right shard key ensures even data distribution, reduces hotspots, and improves query performance. A poor choice can cause uneven load and slow down the system.
Click to reveal answer
intermediate
What are common criteria for selecting a shard key?
Common criteria include high cardinality (many unique values), frequent use in queries, even data distribution, and low update frequency to avoid moving data between shards.
Click to reveal answer
intermediate
Explain the impact of a low-cardinality shard key.
A low-cardinality shard key has few unique values, causing data to cluster in few shards. This leads to uneven load, hotspots, and poor scalability.
Click to reveal answer
intermediate
What is a hotspot in sharding, and how does shard key selection affect it?
A hotspot is a shard that receives a disproportionate amount of traffic or data. Choosing a shard key that evenly distributes data and queries helps prevent hotspots.
Click to reveal answer
Which property is most important for a shard key to ensure even data distribution?
✗ Incorrect
High cardinality means many unique values, which helps distribute data evenly across shards.
What happens if a shard key causes data to cluster on a few shards?
✗ Incorrect
Clustering data on few shards creates hotspots, causing uneven load and performance issues.
Which shard key characteristic helps reduce data movement between shards?
✗ Incorrect
Low update frequency means shard key values rarely change, reducing data movement between shards.
Why should a shard key be frequently used in queries?
✗ Incorrect
Using the shard key in queries helps route queries directly to relevant shards, improving performance.
Which of these is NOT a good shard key choice?
✗ Incorrect
Country code has low cardinality, causing uneven data distribution and hotspots.
Explain how to select a shard key for a large user database.
Think about what uniquely identifies users and how queries are made.
You got /4 concepts.
Describe the consequences of a poor shard key choice in a distributed system.
Consider what happens when data is not balanced across servers.
You got /4 concepts.