← Back to Glossary

Avro

Apache Avro is a row-based binary data serialization format that stores a data schema alongside the data, widely used for message serialization in streaming systems like Kafka and for schema evolution in Hadoop-era pipelines.

Overview

Apache Avro is a binary serialization format built for compactness and schema evolution. Unlike Parquet or ORC, Avro stores data row by row rather than column by column, which makes it a good fit for write-heavy, record-at-a-time use cases like event streaming, rather than analytical scans across many rows.

Schema and evolution

Every Avro file or message is associated with a schema, defined in JSON, describing its fields and types. Avro readers and writers can use different (but compatible) schema versions — a reader can be given the writer's schema alongside its own and Avro will resolve the differences, which is what makes Avro well suited for streaming pipelines where producers and consumers evolve independently over time.

Common use cases

Avro is the default serialization format for many Apache Kafka deployments, often paired with a schema registry that governs which schema versions are compatible. It also has a long history in the Hadoop ecosystem as a row-oriented alternative to columnar formats like ORC and Parquet.

Avro vs. Parquet

Because Avro is row-based, it's efficient for appending and reading whole records — a natural fit for streaming ingestion. Parquet's columnar layout instead favors analytical queries that scan a subset of columns across many rows. A common pattern is to land streaming data as Avro and later convert it to Parquet for analytics.

DuckDB and Avro

DuckDB's avro extension adds a read_avro function that reads Avro files directly, including from remote storage:

Copy code

INSTALL avro; LOAD avro; SELECT * FROM read_avro('s3://bucket/events/*.avro') WHERE event_type = 'purchase';

This lets DuckDB and MotherDuck query Avro data landed by Kafka Connect or similar ingestion tools without a separate conversion step to Parquet first.

Related terms

FAQS

Avro is commonly used to serialize messages in streaming systems like Apache Kafka and to store data in Hadoop-era pipelines, particularly where schemas change over time and row-at-a-time reads and writes are common.

Avro is a row-based format — it stores complete records one after another, which differs from columnar formats like Parquet and ORC that group values by column for analytical scans.

Yes. DuckDB's avro extension provides a read_avro() function that reads Avro files directly from local disk or remote object storage, including glob patterns for multiple files.