🗄️Apache Avro
Also known as Avro, Avro Schema, Avro File
A small file type that keeps whole rows. The plan for the data rides along.
Think of it like
It is like a parcel with the packing list taped on top. You always know what is inside.
Example
An app sends each order as an Avro message. Months later, a field for coupon codes is added, and old readers still work.
Why it matters
Streams change shape over time. Avro's schema rules let a sender and a reader change at different times.
Definition
Example code
json
{"type": "record", "name": "Order",
"fields": [
{"name": "id", "type": "long"},
{"name": "total", "type": "double"}]}Common mistake
Key takeaways
- 1Row by row. Each record is stored whole.
- 2Schema included. The JSON schema travels with the data.
- 3Safe to change. Old and new readers keep working.