Chapter 62. Small Files in a Big Data World
Adi Polak
No matter whether your data pipelines are handling real-time event-driven streams, near real-time data, or batch processing jobs, when you work with a massive amount of data made up of small files, you will face the small files nightmare.
What Are Small Files, and Why Are They a Problem?
A small file is significantly smaller than the storage block size. Yes, even with object stores such as Amazon S3 and Azure Blob, there is minimum block size. A significantly smaller file can result in wasted space on the disk, since storage is optimized by block size.
To understand why, let’s first explore how reading and writing work. For read and write operations, there is a dedicated API call. For write requests, the storage writes three components:
The data itself
Metadata with descriptive properties for indexing and data management
A globally unique identifier for identification in a distributed system
More objects stored means extra unique identifiers and extra I/O calls for creating, writing, and closing the metadata and data files.
To read the data stored, we use an API call to retrieve a specific object. The server checks for the object’s unique identifier on the storage server-side and finds the actual address and disk to read from. A hierarchy of unique identifiers helps us navigate the exabyte object storage capabilities. The ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access