Which sharding approach stores shard assignments in a lookup table and uses a directory before querying data, offering flexibility but adding latency and a potential single point of failure?

Test your Systems Design Concepts knowledge with our comprehensive quiz. Utilize flashcards and multiple choice questions to enhance your study session. Prepare thoroughly with detailed explanations for each answer and ace your examination!

Multiple Choice

Which sharding approach stores shard assignments in a lookup table and uses a directory before querying data, offering flexibility but adding latency and a potential single point of failure?

Explanation:
Sharding with a directory means you keep a central lookup structure that maps each shard key to the specific shard, and every query first consults that directory to route to the right shard. This setup offers flexibility because you can reassign data or rebalance shards by updating the directory without changing application logic. The trade-offs are clear: you pay extra latency for the directory lookup on every query, and there's a potential single point of failure if the directory becomes unavailable or bottlenecks the system. Understand how the others differ: range-based sharding assigns contiguous key ranges to shards directly, which is simple and fast for routing but harder to adapt when you need to rebalance or add shards. Consistent hashing uses a hashing ring so keys map to shards with minimal movement when the topology changes, avoiding a central directory and thus reducing rebalancing work. Two-phase commit is about coordinating transactions across multiple shards and can add latency due to coordination overhead, but it doesn’t define how shard assignments are stored or routed.

Sharding with a directory means you keep a central lookup structure that maps each shard key to the specific shard, and every query first consults that directory to route to the right shard. This setup offers flexibility because you can reassign data or rebalance shards by updating the directory without changing application logic. The trade-offs are clear: you pay extra latency for the directory lookup on every query, and there's a potential single point of failure if the directory becomes unavailable or bottlenecks the system.

Understand how the others differ: range-based sharding assigns contiguous key ranges to shards directly, which is simple and fast for routing but harder to adapt when you need to rebalance or add shards. Consistent hashing uses a hashing ring so keys map to shards with minimal movement when the topology changes, avoiding a central directory and thus reducing rebalancing work. Two-phase commit is about coordinating transactions across multiple shards and can add latency due to coordination overhead, but it doesn’t define how shard assignments are stored or routed.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy