internalsGet Pro

Module 04 · Lesson 7 of 10Pro

The small files problem

Level
Intermediate
Topic
Data formats and file storage
Reading time
17 min

When you finish this page you can

  1. Explain why many small Parquet files cost more to read than a few large ones holding the same rows, naming the per-file listing, footer and row group costs.
  2. Work out how many files a pipeline writes from its batch interval, its partitions and its writers, before it runs.
  3. Choose between batching before writing and writing small then compacting, from how fresh the data must be.
  4. Write a compaction job in DuckDB that rewrites one night of small files into one large file without losing or doubling rows.

Builds on 3 lessons

Start with lesson 317 min
  1. Parquet: columnar files for analytics17 min
  2. Compression and encoding: smaller, faster files17 min
  3. Partitioning files by date and key16 min

2,304 files for one day of clicks

is an online store in India. Its app records about 10 million click events a day. Every night, Meera, Kartly’s data engineer, exports the day’s clicks from to one file, and the ML team reads 13 months of them. The files are moving to in AWS’s Mumbai region.

Our biggest sale ever · Black Friday

Flat 50% Off

Pro

Continue reading

Unlock every course, now and later

  • System Design, live
  • AI Engineering, live
  • Data Engineering, live
  • Machine Learning Engineering, live
  • Inference Engineering, coming soon
  • AI Research, coming soon
  • Performance Engineering, coming soon
  • Agent & Harness Engineering, coming soon
  • LLM Fine-tuning, coming soon
  • LLM Pre-training & Post-training, coming soon
  • Reinforcement Learning, coming soon
  • AI Infrastructure & Platform Engineering, coming soon
  • AI Evaluation & Safety, coming soon
  • Forward Deployed Engineering, coming soon
  • Cloud Computing, coming soon
  • DevOps, coming soon

50% off · Annual and Lifetime

BLACKFRIDAY50Applied at checkout

Choose a plan