We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
System Design Masterclass · Api Design Protocols
Free preview: the first 2 parts of this 7-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Api Design Protocols
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
Protocol Buffers require you to compile .proto files into language-specific code. Every time the schema changes, you recompile and redeploy. For tightly-coupled , this is fine. For big data pipelines where data flows through dozens of systems, some of which you do not control, it becomes a burden.
Apache Avro takes a different approach. The schema is defined in JSON, stored alongside the data (or in a schema registry), and used at runtime. No code generation required. A reader can decode data using any compatible schema, even one that differs slightly from the writer's schema. This "schema resolution" makes Avro ideal for systems where producers and consumers evolve independently.
Avro is the default serialization format for Apache , Hadoop, and the broader data engineering ecosystem. When LinkedIn processes over 7 trillion messages per day through Kafka, those messages are Avro-encoded. Confluent's Schema Registry, which manages Avro schemas for Kafka, handles over 100 billion schema lookups per day across their cloud customers.
Doug Cutting, creator of both Hadoop and Avro, designed Avro specifically to address Protobuf's limitations in Hadoop. The key insight: in batch processing, the schema should travel with the data, not require a separate compilation step.
Schema (JSON):
{
"type": "record",
"name": "User",
"fields": [
{"name": "id", "type": "int"},
{"name": "name", "type": "string"},
{"name": "email", "type": ["null", "string"], "default": null}
]
}
Key differences from Protobuf:
Schema evolution rules:
aliases to maintain compatibilitySchema resolution in detail. Writer wrote with schema v1 (fields: id, name). Reader has schema v2 (fields: id, name, email with default null). Avro resolution: map id to id, name to name, fill email with null. No recompilation. No coordination between teams. The reader adapts to whatever the writer produced, as long as the schemas are compatible.