0
0
HLDsystem_design~5 mins

Database sharding strategies in HLD - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
ADirectory-based sharding
BVertical sharding
CHorizontal sharding
DFunctional sharding
What is a key disadvantage of directory-based sharding?
AIt duplicates data across shards
BIt cannot handle large datasets
CIt only works with vertical sharding
DIt requires a lookup service for every query
Vertical sharding splits data based on:
AColumns or tables
BUser IDs
CRows
DRandom distribution
Which problem is NOT typically caused by sharding?
ACross-shard query complexity
BAutomatic data backup
CIncreased application complexity
DData rebalancing
What is the main goal of database sharding?
ATo improve performance and scalability by splitting data
BTo reduce database size by deleting data
CTo encrypt data for security
DTo merge multiple databases into one
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.