<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt" -->

---
title: Sharding strategies: directory-based, range-based, and...
description: Discover the different types of sharding strategies—directory-based, range-based, and hash-based—along with their pros and cons. Understand how solutions like...
canonical: https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Sharding strategies: directory-based, range-based, and hash-based | daily.dev
og:description: Discover the different types of sharding strategies—directory-based, range-based, and hash-based—along with their pros and cons. Understand how solutions like...
og:url: https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt
og:image: https://api.daily.dev/og/posts/rpv9Y0NWT.png
og:image:alt: Sharding strategies: directory-based, range-based, and hash-based
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

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

**[PlanetScale](https://daily.dev/sources/planetscale)** · 6 min read · 37 upvotes · 0 comments

## Summary

Discover the different types of sharding strategies—directory-based, range-based, and hash-based—along with their pros and cons. Understand how solutions like Vitess and PlanetScale are making sharding more approachable, even though it remains a complex task. Learn how to choose the right sharding strategy based on your database needs while considering the potential challenges like uneven data distribution and added query complexity.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://planetscale.com/blog/types-of-sharding>

---

Tags: [#cloud](https://daily.dev/tags/cloud), [#database](https://daily.dev/tags/database), [#backend](https://daily.dev/tags/backend), [#data-management](https://daily.dev/tags/data-management)

[View this post on daily.dev](https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Sharding strategies: directory-based, range-based, and hash-based","url":"https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt"},"datePublished":"2024-07-08T16:39:25.093Z","dateModified":"2024-08-23T15:57:03.732Z","description":"Discover the different types of sharding strategies—directory-based, range-based, and hash-based—along with their pros and cons. Understand how solutions like...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/af4eb0eb253ee3eb69eb3c15f6a763e0?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/af4eb0eb253ee3eb69eb3c15f6a763e0?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"PlanetScale","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"PlanetScale","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/09515c29cafc45618b3f117eab4fccf8","url":"https://daily.dev/squads/planetscale"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/sharding-strategies-directory-based-range-based-and-hash-based-rpv9y0nwt","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":37},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cloud,database,backend,data-management","timeRequired":"PT6M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"PlanetScale","item":"https://daily.dev/squads/planetscale"},{"@type":"ListItem","position":3,"name":"Sharding strategies: directory-based, range-based, and hash-based"}]}
```

