# Database Sharding

> What is database sharding? How do you choose a shard key, and what problems does sharding introduce?

Canonical: https://www.internhack.in/learn/interview/database-design/db-sharding-patterns
Last updated: 2026-11-28

Difficulty: Advanced

## Question

What is database sharding? How do you choose a shard key, and what problems does sharding introduce?

*The full answer is for InternHack members. Open the page link above to read it.*

## Concepts covered

Horizontal Scaling, Shard Key, Hash Sharding, Range Sharding, Hot Partition, Resharding

Previous: [Isolation Levels](https://www.internhack.in/learn/interview/database-design/db-transaction-isolation-levels) · Next: [Replication Strategies](https://www.internhack.in/learn/interview/database-design/db-replication-master-slave) · [All of Database Design](https://www.internhack.in/learn/interview/database-design)

## More Database Design questions

- [Referential Integrity](https://www.internhack.in/learn/interview/database-design/db-foreign-key-constraints)
- [Composite Keys](https://www.internhack.in/learn/interview/database-design/db-composite-primary-key)
- [Stored Procedures](https://www.internhack.in/learn/interview/database-design/db-stored-procedures-pros-cons)
- [Denormalization](https://www.internhack.in/learn/interview/database-design/db-denormalization-use-case)
- [Views vs. Materialized Views](https://www.internhack.in/learn/interview/database-design/db-view-vs-materialized-view)
- [Concurrency Control](https://www.internhack.in/learn/interview/database-design/db-optimistic-vs-pessimistic-locking)

## Related

- [Learn](https://www.internhack.in/learn)
- [Interview Prep](https://www.internhack.in/learn/interview)
- [Database Design](https://www.internhack.in/learn/interview/database-design)
