Intermediate LevelSystem Design & Architecture
What is Resharding and how do you rebalance database shards without system downtime?
β Interview Prompt: Explain Resharding, online data migration, dual-writing, background backfilling, and cutover validation.
Resharding is the process of adjusting the number of physical database shards when existing shards reach CPU or storage limits:
Zero-Downtime Resharding Pipeline:
1
Provision new database shard nodes.
2
Update routing proxies to dual-write new incoming data to both old and new shards.
3
Run background backfill workers to copy historical records to the new shards.
4
Validate data parity and switch read routing to the new shards.
Code Implementation Example
json
{
"reshardingTask": "Migrate Shard 2 to Shard 2A & 2B",
"dualWriteActive": true,
"backfillProgress": "88% Complete",
"readCutoverScheduled": "2026-07-29T02:00:00Z"
}π‘Zero-downtime database resharding progress payload.
π― Interview Key Takeaway
Execute database resharding using dual-writing and background backfilling to scale storage without maintenance downtime.
#System Design#Resharding#Sharding#Databases#Intermediate
Back to all System Design & Architecture Questionsβ