intermediatebig-data

Data Partitioning & Sharding

Split your data across machines so no single one becomes the bottleneck.

Key Points

What it is

Partitioning (often called sharding in databases) is the practice of splitting a large dataset into smaller pieces distributed across multiple machines or storage locations, so that reads, writes, and processing can happen in parallel instead of all going through one node.

Why it exists

If all data and all requests funnel through a single machine, that machine becomes a bottleneck no matter how many other machines are in the cluster. Partitioning exists to spread both data and workload across many machines so the system can scale roughly linearly as more nodes are added.

Intuition

A single checkout line at a supermarket, no matter how fast the cashier, will always create a bottleneck during rush hour. Open ten checkout lines and spread customers evenly across them, and total throughput scales with the number of lines — as long as customers are actually distributed evenly and don't all pile into one line (a 'hot partition').

When to use

When not to use

Common mistakes

In practice

Central to designing efficient Spark jobs and scalable databases — proper partitioning is often the single biggest factor in whether a distributed job runs in minutes or hours.

Was this concept helpful?

Spot an error or gap? Suggest an edit →

Related concepts

distributed-computing-basicscluster-computing-scalabilityhdfsnosql-databases
Chirp at me!