Your data is not big. Your bill is.

Most companies running a big data stack do not have big data. What the distributed approach costs, how to check your own numbers and what to run instead.

  • BITServices team
  • #data
  • #architecture

Most companies that build a big data platform do not have big data. They have a normal amount of data, a distributed stack built for a much larger one, and a bill that grows every month. This post is about what that costs, how to check whether your data is actually big, and what to run instead.

The numbers

Jordan Tigani was one of the founding engineers of Google BigQuery and saw how thousands of companies used it. In Big Data is Dead he wrote:

  • "the vast majority of customers had less than a terabyte of data in total data storage"
  • "Among customers who were using the service heavily, the median data storage size was much less than 100 GB"
  • "90% of queries processed less than 100 MB of data"
  • "By the time data gets to be a week old, it is probably 20 times less likely to be queried than from the most recent day"

A hundred gigabytes fits in the memory of one ordinary server. Today a single cloud instance can have hundreds of cores and several terabytes of RAM. For most companies, "big" describes the architecture, not the data.

What the big data approach costs

Distributed by default

A distributed system has a minimum size before it does any useful work: coordinator nodes, three replicas of everything, a separate metadata service, a separate scheduler. A query that one machine would answer from memory is split into tasks, the data is shuffled between nodes over the network, and the results are put back together. Every shuffle is network traffic, and in the cloud traffic between zones is billed.

You pay for the coordination even when the data is small, and most of the time it is small.

Schema on read means a full scan on every read

The promise of a data lake is that you do not need a schema. Load the data now and decide what it means later. The cost comes later too. Without a schema there are no indexes, no useful partitions and no sort order, so every question is answered by reading all of the raw data, every time.

One of us worked on Apache Ambari, the tool that installs and manages Hadoop clusters, and saw this from the inside. Clients had reports that took weeks to produce, because all the data was kept raw and there was no way to index it. Each report was a full scan over everything they had ever loaded. The same reports, built on data with a schema, partitions and the right indexes, take about a minute.

"No schema" does not remove the work of designing the data. It moves that work to every single query, and you pay for it again each time one runs.

Copies of copies

A typical data platform keeps the same data many times:

  • the raw files in a landing bucket
  • a cleaned copy, then a modelled copy, often called bronze, silver and gold
  • the same tables loaded into a warehouse
  • part of it indexed again in a search cluster
  • part of it cached again in a fast store for an API
  • backups and snapshots of all of the above

Each copy is storage, a pipeline that keeps it up to date, compute to run that pipeline, and someone who has to fix it when it breaks. Five copies of 200 GB is not big data. It is 200 GB with five times the moving parts.

Keeping everything forever

"Storage is cheap" is true for a file in cold storage. It is not true for data that is indexed, replicated three times, kept on fast disks, backed up every night and scanned by queries that only needed last week.

If data a week old is twenty times less likely to be read, most of what sits in the expensive tiers is paid for and almost never used.

Streaming what is read once a day

Kafka, stream processors and real-time pipelines make sense when someone acts on the data within seconds. Often the only consumer is a dashboard that people open in the morning. A nightly batch job would give the same result with a fraction of the infrastructure, and nobody on call for it at 3 a.m.

Data in the wrong system

We regularly see data stored where it is most expensive to keep:

  • a search cluster used as the main store for everything, with indices that were never partitioned and shards so large that the cluster needs the largest nodes available
  • files and binaries sent through a message bus, paid for by size on every hop
  • full event payloads copied into every service that might need them one day

None of this is big data. It is normal data in the wrong place.

The team becomes the platform

The largest cost is often not on the cloud bill. A team of data engineers spends its time keeping clusters, schedulers and pipelines alive, upgrading versions and fixing broken jobs, instead of answering questions with the data.

A real example

A large consumer app analysed customer behaviour the classic way. About 800 GB of raw events arrived every day and landed in S3 as Parquet. AWS Glue and Spark jobs on large EMR clusters processed them, and the results fed the reports. The clusters were huge, and the analytics were always behind.

We rebuilt it around one small service, an ingester:

  1. The ingester aggregates events as they arrive, in 15-minute intervals.
  2. The aggregates go into PostgreSQL, which keeps one day of data. Yes, plain PostgreSQL.
  3. Pre-aggregated data goes into Elasticsearch, where the dashboards and reports read it.
  4. The raw events go to S3 as Parquet. We could not convince the client that they did not need the raw data. That is a fair compromise: raw data in cheap storage, in a columnar format, read only on the rare day someone needs it.

800 GB a day is real volume, more than most companies ever see. It still did not need a cluster to answer questions. Aggregated into 15-minute intervals, a whole day of it fits easily in one PostgreSQL database.

There is no cluster in the path of a normal report any more. Every question the analysts asked became almost real-time, instead of waiting for the next batch job on EMR.

The data had not changed. What changed was the decision about when to do the work: once, when the data arrives, instead of again in every job that reads it.

How to check whether your data is big

You do not need a project for this. A few queries answer it.

  1. How much data do your queries actually read? In BigQuery, look at total_bytes_processed in INFORMATION_SCHEMA.JOBS. In Snowflake, look at BYTES_SCANNED in ACCOUNT_USAGE.QUERY_HISTORY. Look at the median and the 95th percentile, not the total.
  2. How old is the data people read? Group queries by the age of the data they touch. If almost everything is about the last 30 days, the rest does not need to be hot.
  3. How many copies do you keep? List every place the same data lives, with its size and the pipeline that fills it.
  4. What would fit on one machine? Compare the size of the data you query every day with the memory of one large server.

If the median query reads megabytes and the working set is under a few hundred gigabytes, your data is not big, whatever the architecture says.

What to run instead

  • One strong machine. Postgres goes a long way. A single ClickHouse server handles analytical queries over billions of rows. DuckDB runs analytics straight on Parquet files without a cluster at all.
  • A schema when the data arrives. Decide the types, the partitions and the indexes when the data is written, so a query reads only what it needs instead of scanning everything.
  • Aggregate when the data arrives. Keep raw events for a short time and the aggregates for as long as you need them. Most reports never needed the raw rows.
  • A lifecycle for every dataset. Hot, then cheaper storage, then deleted, on a schedule decided when the dataset is created, not years later.
  • Batch where nobody needs real time. Keep streaming for the cases where someone acts on the data within seconds.
  • One copy per purpose, with an owner. Every copy has a reason, a person responsible and a retention period. A copy without all three gets deleted.
  • Partition by how the data is read. By time, by tenant or by whatever the queries filter on, so a query reads only what it needs.

When your data really is big

Some companies have it: large ad platforms, telemetry from millions of devices, training data for large models. For them distributed systems are the right tool. The difference is that they chose it because the numbers required it, and they engineer for it on purpose: what to keep, for how long, in which form.

For everyone else the better question is not "which big data stack should we use?" but "what is the smallest system that answers our questions?" It is usually much smaller, much cheaper and much easier to run than the one in production today.