# Apache Avro

> A small file type that keeps whole rows. The plan for the data rides along.

**Field:** Data Engineering  
**Category:** Storage & Warehousing  
**Also known as:** Avro, Avro Schema, Avro File

## Think of it like

It is like a parcel with the packing list taped on top. You always know what is inside.

## Definition

Apache Avro is an open file format that stores data row by row in a small binary form. Its schema is written in JSON and travels with the data. A reader uses the schema to decode each record. Fields can be added or removed over time, with rules that keep old and new readers working. It is popular for messages in event streams.

## Example

An app sends each order as an Avro message. Months later, a field for coupon codes is added, and old readers still work.

## Example code

```json
{"type": "record", "name": "Order",
 "fields": [
  {"name": "id", "type": "long"},
  {"name": "total", "type": "double"}]}
```

An Avro schema for an order. Every record is written and read with it.

## Why it matters

Streams change shape over time. Avro's schema rules let a sender and a reader change at different times.

## Common mistake

Using Avro files for big reports. It stores rows, so a query on two columns still reads every field.

## Three principles

- **Row by row.** Each record is stored whole.
- **Schema included.** The JSON schema travels with the data.
- **Safe to change.** Old and new readers keep working.

## Related terms

- [Apache Parquet](https://learn.benibix.com/term/data/apache-parquet)
- [Apache ORC](https://learn.benibix.com/term/data/apache-orc)
- [JavaScript Object Notation (JSON)](https://learn.benibix.com/term/development/json)
- [Stream Processing](https://learn.benibix.com/term/data/stream-processing)
- [Row-Oriented Storage](https://learn.benibix.com/term/data/row-oriented-storage)
- [Protocol Buffers (Protobuf)](https://learn.benibix.com/term/development/protocol-buffers)

## Told apart from

- [Apache Parquet vs Apache Avro](https://learn.benibix.com/compare/parquet-vs-avro): People think Parquet and Avro do the same job. Both are open file formats with a schema. Parquet stores data by column, so reports that read a few columns are fast. Avro stores whole rows, so it suits sending one record at a time, as in event streams.

---

Source: https://learn.benibix.com/term/data/apache-avro
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
