(+351) 21 24 10006  ·  info@bconcepts.pt
Carnaxide, Lisbon
Data partitioning: the decision that makes a data lake fly or crawl
Data Engineering

Data partitioning: the decision that makes a data lake fly or crawl

Equipa bConcepts 01/07/2025 6 min

Two companies store exactly the same data, on the same platform, with the same hardware. In one, a query runs in seconds; in the other, the same query takes minutes and costs ten times more. The difference is not in the data nor the tool — it is in a design decision almost nobody discusses out loud but that decides whether a data lake flies or crawls: partitioning. It is one of those invisible choices that appear in no demo, but that separate a fast, cheap data platform from a slow, expensive one.

Partitioning is the art of physically organizing data so that queries only need to read what matters. It is the data-world equivalent of tidying a warehouse: if the products are organized by aisle and shelf, you find what you are looking for in an instant; if they are all piled up with no criterion, you have to rummage through everything each time. At small volume, the mess goes unnoticed; at large scale, it is the difference between operating well and drowning.

The problem of reading everything to answer a little

Imagine you store years of transactions in a data lake and want to analyze a single month's sales. Without partitioning, the system does not know where that month's sales are — they are mixed in with all the others. To answer, it has to read the whole set, filter what matters and throw away the rest. You read billions of rows to use a fraction of them. That wasted work translates directly into wait time and processing cost, because in the cloud you pay for what the system reads.

Data partitioning: the decision that makes a data lake fly or crawl

It is this waste that grows dangerously with scale. With little data, reading everything is fast and cheap, and nobody cares. But as the volume increases, each query that reads the whole set gets slower and more expensive, linearly. There comes a point where the platform, which seemed to work well, becomes painfully slow and the bill spikes — and the cause is rarely obvious, because nothing "is broken"; it is just poorly organized.

The core idea: divide by what you search on

Partitioning solves this by dividing the data into pieces — the partitions — by a column you usually filter on. The most common case is the date: each day's, or each month's, data goes in its own separate piece. That way, when a query asks for "March's sales", the system knows to go straight to the March partition and ignore all the others. Instead of reading the whole set, it reads a tiny slice. It is the same query, the same data, but with an organization that lets the system skip what does not matter.

The choice of partitioning column is therefore the decision that decides everything. The rule is to divide by the column you filter on most in real queries. If almost all analyses are by period, partition by date. If many are by region, region may be a good candidate. Partitioning by the wrong column — one nobody filters on — helps nothing, because queries still have to read everything. Knowing the real access patterns is what separates good partitioning from useless partitioning.

The other extreme: too many partitions also kill performance

It would be tempting to conclude that the finer the partitioning, the better — divide by day, by hour, by minute. But there is a limit, and crossing it has the opposite effect to the one desired. Each partition is, typically, one or more files; dividing too much generates a multitude of tiny files. And reading thousands of tiny files is, paradoxically, slower than reading a few files of a healthy size — the system gets lost opening and closing files instead of processing data. It is the famous "small files problem", one of the most common causes of a slow data lake.

The balance, then, is not "the more partitions the better", but "partitions of the right size". Too big and queries read more than they need; too small and the system drowns in files. Finding the right point — dividing enough to skip the irrelevant, but not so much that it fragments into crumbs — is the essence of good partitioning.

A concrete case

A company had a data lake with several years of events and complained that analysis queries were extremely slow and the processing bill kept rising. The first reaction was to think about buying more capacity. Before that, someone looked at how the data was organized and found the root of the problem: the events were all together, with no partitioning, even though practically every query filtered on a date range. Each query, however narrow, was forced to read all the years. They reorganized the data partitioned by date. The effect was immediate and dramatic: the queries analyzing a short period started reading only that period's partitions, and the time dropped from minutes to seconds, with the processing bill falling in the same proportion. They did not buy a single extra server — they just tidied the data so the system could skip what it did not need to read. The same platform, a different design decision, a problem solved at the root.

A design decision, not an accident

The most important lesson is that partitioning should not be left to chance. It is a design decision made early, based on how the data will be queried, and reviewed as the patterns change. A good choice here pays dividends on every query, every day, forever; a bad choice, or the absence of a choice, charges a silent tax on every query, also forever. Few technical decisions have such a disproportionate return relative to the effort of making them well.

In practice

If your data lake is slow and expensive as it grows, before buying more capacity, look at how the data is physically organized. Ask: which column do most of my queries filter on, and is the data divided by that column? Often, the answer to those two questions is the cheapest and most effective path to a fast platform. Is your data tidied so the system skips what does not matter, or is it reading everything, always, to answer a little?

← Back to insights
Let's talk?

Ready to transform your data?

Book a free 30-minute meeting and find out how we can help your team make better decisions.

Book a Free Meeting
bConcepts