Recall & Review
beginner
What is database sharding?
Database sharding is a technique to split a large database into smaller, faster, and more manageable parts called shards. Each shard holds a portion of the data, helping improve performance and scalability.
Click to reveal answer
beginner
Explain horizontal sharding.
Horizontal sharding divides data by rows. Each shard contains a subset of rows from the same table, often based on a key like user ID. This spreads the load across multiple servers.
Click to reveal answer
intermediate
What is vertical sharding and when is it used?
Vertical sharding splits data by columns or tables. Different shards hold different parts of the schema. It is useful when some tables or columns are accessed more frequently or require different resources.
Click to reveal answer
intermediate
Describe directory-based sharding.
Directory-based sharding uses a lookup service to map each data item to its shard. This allows flexible shard assignment but adds a dependency on the directory for every query.
Click to reveal answer
advanced
What are common challenges of database sharding?
Challenges include data rebalancing when shards grow unevenly, handling cross-shard queries, maintaining consistency, and increased complexity in application logic.
Click to reveal answer
Which sharding strategy splits data by rows across multiple shards?
✗ Incorrect
Horizontal sharding divides data by rows, distributing subsets of rows across shards.
What is a key disadvantage of directory-based sharding?
✗ Incorrect
Directory-based sharding depends on a lookup service to find the shard, adding overhead and a potential single point of failure.
Vertical sharding splits data based on:
✗ Incorrect
Vertical sharding divides data by columns or tables, separating parts of the schema into different shards.
Which problem is NOT typically caused by sharding?
✗ Incorrect
Automatic data backup is not a direct problem caused by sharding; it is usually handled separately.
What is the main goal of database sharding?
✗ Incorrect
Sharding splits data into smaller parts to improve performance and allow the system to scale.
Describe the main types of database sharding strategies and when to use each.
Think about how data is divided: by rows, columns, or using a directory.
You got /5 concepts.
What challenges arise from implementing database sharding and how can they affect system design?
Consider operational and development difficulties after splitting data.
You got /4 concepts.