Replication, Partitioning, and Sharding Questions

Scaling and distributing data across nodes: primary-replica and multi-primary replication, read-replica scaling, horizontal partitioning, and sharding strategies with their key-selection and rebalancing challenges. Covers replication lag, failover and split-brain handling, cross-shard operations such as joins, distributed transactions, and global secondary indexes, and the operational cost of a partitioned topology. Key to designing databases that scale horizontally.

MediumTechnical
86 practiced

A single large tenant generates the majority of writes and creates a hotspot on their shard. Design strategies to mitigate this at scale: dynamic intra-tenant sharding, per-tenant rate-limiting, write queuing, specialized storage tiers, and routing. Explain how to detect the tenant early and how to migrate them with minimal disruption.

HardTechnical
132 practiced

Top 0.1% of keys account for 80% of traffic, creating severe hotspots. Design an architecture to handle heavy hot keys at scale with minimal latency. Discuss trade-offs among multi-level caching, read/write fan-out, key splitting (sharding subkeys), adaptive throttling, and operational complexity of each approach, and explain how you would migrate a hot key offline to a split representation.

HardSystem Design
102 practiced

Design a zero-downtime re-sharding strategy (changing shard key or increasing shard count) for a primary events table expected to grow from 100TB to 800TB. Include steps for data migration, dual-write patterns, backfill, cutover, consistency guarantees during cutover, automated rebalancing, and rollback paths. Explain operational concerns such as migration bandwidth, impact on latency, and verification of data correctness.

MediumTechnical
87 practiced

What is consistent hashing and how does it reduce data movement when the number of shards changes? Explain the role of virtual nodes and how they improve load distribution on the hash ring.

MediumTechnical
70 practiced

Develop a cost model to compare two choices for scaling a sharded datastore: adding more smaller instances versus upgrading to fewer larger instances. Include hardware, licensing, operational overhead, failover impact, and migration complexity in your model and describe how you'd apply it to a decision.

Unlock Full Question Bank

Get access to all Replication, Partitioning, and Sharding interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.