0Pricing
SQL Academy · Lesson

Sharding Strategies: Range, Hash, Directory

Compare range, hash and directory-based sharding, and pick a shard key that balances load and stays stable.

What Is Sharding?

Splitting one logical database across multiple physical servers ("shards"), each holding a subset of the data. Done when one server can't handle the workload anymore.

Sharding ≠ Replication

  • Replication — same data on many servers (for HA, read scaling)
  • Sharding — different data on different servers (for write scaling, capacity)

You often combine both: each shard replicated for HA.

All lessons in this course

  1. Sharding Strategies: Range, Hash, Directory
  2. Cross-Shard Queries: The Hard Problem
  3. Citus and Distributed Postgres
  4. When NOT to Shard
← Back to SQL Academy