---
answer: direct
beat: system-design
source: 1 article · updated: November 17, 2026
---

What's the difference between range-based and hash-based sharding?

Range-based sharding assigns contiguous key ranges to each shard (users A-M on shard 1, N-Z on shard 2) — simple and good for range queries, but prone to hotspots if data or traffic isn't evenly distributed across ranges. Hash-based sharding applies a hash function to the shard key to distribute rows evenly across shards, solving the hotspot problem but making range queries expensive since adjacent keys land on unrelated shards.

Answered in

Database Sharding: What It Actually Costs When You Split the Database

Sharding scales a database past one machine's limits, but it changes joins, transactions, and query patterns. Here's what each strategy trades away.

Crashtech Editorial November 17, 2026 System Design & Architecture

Read the full analysis

Other questions this article answers

More system design & architecture questions

Every answer on Crashtech is written by the editor of the article it comes from — never auto-summarised. Browse all answers or the System Design & Architecture beat.