Binary serialization
Compact, schema-driven encodings for one record or message at a time: the bytes between services and inside event streams.
How they work
Avro, Protocol Buffers and Cap’n Proto all start from a schema and encode records in binary, but differently. Avro writes no field names or type tags, so its bytes are small and a reader needs the writer’s schema. Protocol Buffers tags each field with the number it has in the .proto file. Cap’n Proto lays a message out like an in-memory struct, so reading it needs no parse step.
Schemas let producers and consumers upgrade at different times. Avro’s schema resolution matches fields by name and fills in defaults, Protocol Buffers keeps old field numbers stable, and on Kafka a schema registry stores each version and checks that new ones stay compatible.
These are row formats: they write whole records one after another, which suits messages and appends. For scanning one column across millions of rows, data usually lands in columnar files.
Technologies
What all file formats have in common →Binary serialization
Also binary serialization
Cap’n ProtoOpen sourceA binary format laid out like an in-memory struct, so reading needs no parse step, plus an RPC system built on object references and promise pipelining.Mainly Remote procedure calls
Protocol BuffersOpen sourceGoogle’s schema-first binary encoding: messages defined in `.proto` files, fields identified by number, code generated for each language.Mainly Remote procedure calls| Binary serialization | Open source | Apache Software Foundation | Apache 2.0 | 2026-10-05 | |
| CBOR | Binary serialization | Open source | IETF (open standard, RFC 8949) | Open standard, free to use | 2026-10-09 |
Cap’n Proto | Also binary serialization | Open source | Cloudflare, Inc. | MIT | 2026-10-06 |
Protocol Buffers | Also binary serialization | Open source | Google LLC | BSD 3-Clause (Apache 2.0 until version 2.0.2 in September 2008) | 2026-10-06 |
Sources
- Apache Avro specification: schemas, binary encoding, container files and schema resolution
- Protocol Buffers docs: Encoding (varints, tags, wire types)
- Protocol Buffers docs: Language guide, proto3 (field numbers, updating a message type)
- Cap’n Proto: Introduction (no encoding step)
- Confluent docs: Schema evolution and compatibility
- Apache Parquet docs: Motivation (columnar storage for analytics)