Home / Companies / PlanetScale / Blog / Post Details
Content Deep Dive

Sharding strategies: directory-based, range-based, and hash-based

Blog post from PlanetScale

Post Details
Company
Date Published
Author
Holly Guevara
Word Count
1,168
Company Posts That Month
6
Language
English
Hacker News Points
-
Post removed?
No
Summary

Sharding strategies can be categorized into three types: directory-based, range-based, and hash-based. Directory-based sharding involves mapping data to shards using a lookup table, which is useful for specific criteria but may result in uneven data distribution and an extra query step. Range-based sharding splits up the shard mapping based on a range of values, which can lead to overloaded shards but allows for easy resharding operations. Hash-based sharding distributes data evenly across shards using a hash function, minimizing human guesswork and offering easier resharding options. PlanetScale typically recommends hash-based sharding as the default option due to its simplicity and effectiveness in maintaining an even distribution of data.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.