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 9-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
Picture this: 50 communicate through Kafka. Service A publishes "OrderPlaced" events. Services B, C, and D consume them. Service A ships a release that renames customerId to customer_id. Services B, C, and D break in production at 2 AM because they expected the old field name.
This happens constantly in organizations without schema governance. LinkedIn's streaming infrastructure team reported that uncoordinated schema changes were their number one source of data pipeline outages before they adopted a schema registry. Netflix documented a similar pattern: producer teams would evolve event schemas without realizing they had 12 downstream consumers depending on every field.
A schema registry is a centralized store for all message schemas. Producers register their schema before publishing. Consumers fetch the schema before deserializing. And critically, the registry enforces compatibility rules. Before a new schema version is accepted, the registry checks it against previous versions. Incompatible changes are rejected at registration time, not at 2 AM in production.
Confluent Schema Registry (for ) is the most widely deployed, handling over 10 trillion messages per day across its cloud customers. AWS Glue Schema Registry integrates with MSK and Kinesis. Apicurio Registry is the open-source alternative with no vendor lock-in. Azure Schema Registry plugs into Event Hubs. The concept is identical: centralize schema governance so breaking changes are caught before they reach production.
Producer flow:
Consumer flow:
The schema ID adds 5 bytes of overhead per message (1 magic byte + 4 ID bytes). Negligible. But those 5 bytes mean any consumer can decode any message from any producer at any point in schema evolution, using the exact schema that produced it.
Serialization format matters. Avro is the most common choice for Kafka because its schema is separate from the data, enabling the registry pattern naturally. Protobuf works well too, with the schema compiled from .proto files. JSON Schema is the least efficient (larger payloads, no binary encoding) but the most familiar to teams coming from REST APIs. The JSON Schema lesson runs a closed schema, an added optional field and a newly required one against old and new messages, so you can see which change breaks which reader.
| Format | Binary | Schema Evolution | Payload Size | Registry Support |
|---|---|---|---|---|
| Avro | Yes | Best (schema separate from data) | Smallest | Native |
| Protobuf | Yes | Good (field numbers) | Small | Native |
| JSON Schema | No (text) | Limited (no field renaming) | Largest | Supported |
It is easy and good
“It is really nice and good Please join the course”