# Database Sharding Explained: Techniques, Trade-offs and When to Use It

Database sharding basics: geo, range and hash-based sharding, manual vs automatic sharding, hotspots, and the pros and cons before you split your database.

- Source: https://raleche.com/story/database-sharding-partitioning-system-design
- Published: 2026-11-17
- Author: Tech Team Strategy (RALECHE)
- Speaker: Database Sharding
- Tags: Exponent, Aced, Database Sharding, Partitioning, System Design, Databases, Scalability, Interviews

> An executive summary of this story is available to members at https://raleche.com/story/database-sharding-partitioning-system-design.

---

> Watch the original interview: [YouTube](https://www.youtube.com/watch?v=be6PLMKKSto)

In a short explainer, **Aced (formerly Exponent)**, the interview-prep company, covers **database sharding**: what it is, the main techniques, manual versus automatic sharding, and the advantages and disadvantages to weigh before you split a database.

This article is our own summary, with short quotes, from the video's automatic transcript. Watch the full video above for everything that was said.

## The short version

-   **Why shard.** Traditional relational databases hit CPU, memory or disk bottlenecks as data grows, and need ever more expensive hardware. Sharding breaks large tables into horizontal partitions, each holding a subset of rows, and puts each on its own database server. Each partition is a **shard**.
-   **Three common techniques:** geo-based, range-based and hash-based sharding, each with its own risk of uneven data.
-   **Automatic beats manual.** Some databases repartition data on their own when it becomes uneven. Many monolithic databases can't, which pushes sharding into the application, with real costs.
-   **The upside:** scale out, faster queries on smaller indexes, partial outages instead of total ones, and cheaper commodity hardware.
-   **The downside:** not all data shards well, cross-shard joins are expensive or impossible, sharding is hard to undo, and every shard is a production server to keep available.

## Sharding techniques

-   **Geo-based:** partition by user location, such as a continent or "East US" versus "West US," usually fixed at account creation. Users reach the nearest node, which reduces latency, but users may not be spread evenly.
-   **Range-based:** partition by ranges of a key, for example the first letter of a first name, which gives 26 buckets for English names. Simple to compute, but splits can be uneven.
-   **Hash-based:** hash the key and use the hash to pick the partition. A good hash spreads data evenly and avoids hotspots, but related rows often land on different shards, so the server can't predict and preload future queries.

## Manual versus automatic sharding

With **automatic sharding**, the database manages partitions and rebalances them when it detects uneven data or queries, which gives better performance and scalability. When the database doesn't support it, sharding moves to the **application layer**, and the video lists the downsides:

-   Much more development complexity: choosing the technique and the number of shards from projected data trends, then rebalancing at runtime if those assumptions change, and knowing which shard holds each piece of data.
-   Uneven distribution as data trends drift, creating **hotspots** that can cause performance problems and server crashes.
-   Repartitioning when the original number of shards was too low, which is hard with no downtime.
-   Schema changes that must be applied, and data migrated, correctly on every shard.

## Advantages

1.  The system can scale out as data grows, beyond what a single relational database can handle.
2.  Smaller data per shard means smaller indexes and faster queries.
3.  An outage on one shard leaves most of the system available.
4.  Shards can run on commodity hardware instead of expensive high-end servers.

## Disadvantages

1.  Not all data is suited to sharding; foreign key relationships only hold within a single shard.
2.  Manual sharding is complex and can create hotspots.
3.  Cross-shard queries such as joins are very expensive or not possible.
4.  Once set up, sharding is very hard (on some systems impossible) to undo, and the shard key is hard to change.
5.  Each shard is a live production server needing high availability through replication, which raises operating costs.

## What it means for your business

1.  **Don't shard first.** Try indexing, caching and read replicas before splitting your database.
2.  **Choose the shard key with care.** It is hard to change later and decides whether data stays even.
3.  **Prefer databases that shard automatically** if you expect large growth.
4.  **Design so most queries stay inside one shard,** for example by customer or region.
5.  **Budget for operations.** More shards means more servers to monitor, back up and replicate.

## Video details

-   **Title:** The Basics of Database Sharding and Partitioning in System Design
-   **Published by:** Aced (formerly Exponent) on YouTube
-   **Watch:** [youtube.com/watch?v=be6PLMKKSto](https://www.youtube.com/watch?v=be6PLMKKSto)
-   **Note:** this summary is based on the video's automatic transcript. Check the video for exact wording.

## Want to put this to work?

We help owners turn AI trends into a plan, a product and a launch. [Book a free call](https://calendly.com/davidraleche/30min) or [see our services](https://tech-team-strategy.com/services).
