Explain Schema Registry and Avro vs Protobuf.
A schema registry is a central service that stores and manages schemas (like Avro or Protobuf) to ensure consistent data formats and safe schema evolution across distributed systems.
When to Use
Use a schema registry when multiple services exchange structured messages.
It enforces a single source of truth for schema versions, critical in event-driven systems, data pipelines, and microservices.
Example
An e-commerce app might publish order events in Avro, register the schema, and allow analytics services to fetch and decode them with guaranteed compatibility.
Want to master concepts like this?
Explore Grokking System Design Fundamentals, Grokking the System Design Interview, Grokking Database Fundamentals for Tech Interviews, or Mock Interviews with ex-FAANG engineers.
Why Is It Important
Schemas act as contracts. A registry prevents misinterpretation of data, supports versioning, and ensures smooth evolution as fields are added or updated.
Interview Tips
Be prepared to compare Avro vs Protobuf: Avro is schema-driven and flexible (no codegen), while Protobuf is faster, compact, but requires code generation. Mention how a registry guarantees compatibility.
Trade-offs
A registry adds operational overhead but ensures strong guarantees. Avro simplifies evolution, Protobuf optimizes size and speed. The choice often depends on ecosystem and performance needs.
Pitfalls
Common mistakes include breaking backward compatibility by removing fields, or forgetting to update consumer code after schema changes, leading to runtime errors.
GET YOUR FREE
Coding Questions Catalog
$197

$78
$78