Question 5 of 10Pro Only
Your application database is becoming a bottleneck. Walk me through how you would implement database sharding. What sharding strategies would you consider, and what are the trade-offs of each?
Sample answer preview
Database sharding is a powerful technique, but it introduces significant complexity. Let me walk through my approach. Before sharding, I would first exhaust simpler options. Can we optimize queries? Add proper indexes? Implement caching? Use read replicas?
shardingpartition keyconsistent hashingcross-shard queriesrebalancingrange-based