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
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
81 practiced

Explain database federation as an alternative to sharding: querying across multiple independently-owned databases without redistributing their data. Describe one scenario where federation is preferable to sharding, and one where federation introduces unacceptable complexity.

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.

MediumTechnical
77 practiced

Describe three common sharding strategies: range-based sharding, hash-based sharding, and directory (lookup)-based sharding. For each strategy explain how keys are mapped to shards, typical advantages, failure modes (hotspots, rebalancing cost), and a concrete scenario where it is usually preferred.

EasyTechnical
73 practiced

Describe the difference between sharding and replication. Give specific examples of how each affects availability, latency, capacity, and consistency in a production database architecture. When would you choose one over the other for a new service?

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.