Database Sharding | Database Interview | Skill-Lync Resources
Medium Database Systems Distributed Databases

What is database sharding and what are its strategies?

Answer

Sharding horizontally partitions data across multiple database instances for scalability. Strategies: Range-based (shard by value ranges - e.g., user IDs 1-1M on shard1), Hash-based (consistent hashing of key - even distribution but no range queries), Directory-based (lookup service maps keys to shards - flexible but lookup overhead), Geographic (by user location). Challenges: cross-shard queries, transactions across shards, rebalancing. Often used with application-level routing.

Master These Concepts with IIT Certification
IIT Certified

Master These Concepts with IIT Certification

175+ hours of industry projects. Get placed at Bosch, Tata Motors, L&T and 500+ companies.

Relevant for Roles

Senior Software Engineer Database Architect Systems Engineer