concept Parquet in category cloud

appears as: Parquet
Designing Cloud Data Platforms

This is an excerpt from Manning's book Designing Cloud Data Platforms.

Given these factors, it’s not surprising that flexible storage was one of the first services offered by cloud vendors. Cloud storage doesn’t impose any restrictions on the types of files you can upload – you’ve got free rein to bring in text files like CSV or JSON, binary files like Avro, Parquet, images, video – just about anything can be stored in the data lake. This ability to store any file format is an important foundation of a data lake, because it allows you to store raw, unprocessed data and delay its processing until later.

Avro and Parquet file formats

Both Avro and Parquet are binary file formats. Unlike CSV, JSON and XML which are text formats, Avro and Parquet are not stored in a human-readable format and require a special program to decode and encode actual data. While there are many different binary file formats that are being used in the data space today, Avro and Parquet are two of the most popular.

Binary file formats offer several advantages over text-based file formats. First, binary formats take significantly less space on disk, because of different optimizations they can apply during data encoding. Both Avro and Parquet include column type information which allows for much better file compression. We have seen reductions of up to 10x the original data size by going from a text-based file format to a compressed binary format. Smaller file sizes not only reduce your cloud storage costs, but also significantly speed up your data processing pipelines.

A second advantage of binary file formats is that they enforce the use of a certain schema for all files. This means that before saving any data in Avro or Parquet format you must define which columns and column types exist in your data set. In Avro file format this schema is actually embedded into every single file, so any program or data pipeline that reads these files will be automatically aware of all column names and their types. Schema and file format standardization definitely requires extra development and maintenance efforts in comparison with just storing all data as is but in our experience this effort pays for itself many times over when you need to deal with more than just a handful of pipelines or have to expose data in the platform to different data consumers. We will talk about schema management in more detail in Chapter 8.