Scrivio Interview library
LeadershipAdvanced6 min read · updated 12 November 2026

Should your organisation standardise on Avro, Protobuf or JSON Schema for Kafka events, and how strict should compatibility rules be? Lay out how you would decide.

I would decide with the teams' real constraints in front of us: language support and tooling, payload size, readability and the data already in Kafka. Avro and Protobuf give compact binary encoding and well-defined evolution rules; JSON Schema is readable but larger, and its compatibility checks are weaker in practice. Whatever we pick, we set a default compatibility mode, usually BACKWARD or BACKWARD_TRANSITIVE, define how breaking changes are made, treat event schemas as public APIs with owners, and pilot with a few teams with code generation and test tools before making it mandatory.

Why this question is asked

Choosing a serialization format sounds like a technical detail, but for an event platform it is closer to choosing a language every team must speak for years. Changing it later means migrating every topic and every consumer. Interviewers ask this leadership question to see whether we can make a lasting technical decision with many stakeholders, using clear criteria rather than personal preference. In this answer, we will set out the criteria, compare the three formats against them, decide the compatibility rules, describe how schemas are governed as APIs, and plan a rollout that earns adoption.

1Start From the Criteria, Not the Format

Before comparing formats, we gather facts. Which languages do our teams use? A Java and Kotlin shop has excellent support for all three, while teams in Go, Python or TypeScript may find one format's code generation more mature than another's. What tooling do we have: a schema registry, IDE plugins, a data catalogue, a warehouse loader that reads one format natively?

Then the data itself. How large and how frequent are the events, and does payload size matter for cost or latency? Do people need to read events in tools and logs, for example in support cases? And what is already in Kafka: if 300 topics already carry JSON, moving to a binary format has a real migration cost that should be weighed, not ignored.

2Comparing the Three Formats

Avro and Protobuf are both binary formats with schemas. Avro writes no field identifiers at all and depends on the writer schema at read time, which the registry supplies; its resolution rules for defaults and aliases are clear and well tested, and it fits naturally with the Java data ecosystem and many analytics tools. Protobuf identifies fields by number, so names can change freely as long as numbers stay, and it has very strong multi-language support and is common where gRPC is already in use.

JSON Schema keeps events as JSON text, which anyone can read in a log or a console. The cost is size, often two to five times larger than binary, and parsing time. Its compatibility checking is also harder in practice: JSON Schema allows open content models, where extra properties are permitted, and the registry's rules for what counts as compatible depend on those details, so teams get fewer real guarantees from the same check.

Format comparison for Kafka events
CriterionAvroProtobufJSON Schema
EncodingBinary, no field idsBinary, numbered fieldsText (JSON)
Payload sizeSmallestSmallLargest
Human-readable on the wireNoNoYes
Evolution rulesClear: defaults, aliasesClear: keep field numbersWeaker in practice
Multi-language codegenGoodVery goodVaries by language
Fit with analytics toolsVery goodGoodGood
No row decides alone; weigh them against our teams and data.

3Making the Decision

With the criteria in hand, the decision usually becomes clear. For a mostly Java organisation with analytics needs, Avro is a strong default. For an organisation with many languages and existing gRPC services, Protobuf often wins because teams already know it and its numbered fields make evolution forgiving. JSON Schema suits low-volume integration topics, especially at the edges with partners, where readability matters more than size.

It is fine to choose one default and allow one exception with a reason, for example Protobuf by default and JSON Schema for partner-facing topics. What we avoid is every team choosing freely, which leads to five formats, five sets of tooling and consumers that must understand all of them. The decision and its reasons go into an architecture decision record.

4Choosing Compatibility Rules

The format alone does not protect consumers; the compatibility mode does. We pick a platform default, usually BACKWARD, which lets consumers upgrade first and read older data, or BACKWARD_TRANSITIVE for topics with long retention or replays from the beginning, where new consumers must read every version ever written. FULL or FULL_TRANSITIVE suits the most widely shared topics, where we cannot control who upgrades first.

Then we define how a breaking change is made, because sometimes one is needed. The usual rule is a new topic, such as customers.v2, or a new subject, with a dual-publishing period and a planned retirement of the old one. Turning compatibility off on a live subject is not allowed. Writing this down in advance means a breaking change becomes a known procedure rather than an argument.

Java
# Platform default, set once on the registry
curl -X PUT -H "Content-Type: application/vnd.schemaregistry.v1+json" \
--data '{"compatibility": "BACKWARD_TRANSITIVE"}' \
http://schema-registry:8081/config
# {"compatibility":"BACKWARD_TRANSITIVE"}

5Treating Schemas as Public APIs

An event schema is an API: other teams build on it, and changing it carelessly breaks them. So each schema has an owning team, documentation of what each field means and when the event is emitted, and a review process for changes in which consumers can comment. Schemas live in version control, changes run the registry compatibility check in CI, and production producers do not auto-register.

This also changes how teams design events. Fields are named for the business meaning, optional fields have sensible defaults, and personal data is marked so the governance tools can find it. A schema that is reviewed like an API tends to stay stable for years.

6Pilot Before Mandating

A standard that arrives as a memo is resisted; a standard that saves teams work is adopted. So we pilot with two or three teams with different languages and needs, and build what they need along the way: a build plugin that generates classes from schemas, a Spring Boot starter that configures serializers and the registry, a CLI for compatibility checks, and test helpers such as an embedded or mock registry for unit tests.

After the pilot, we publish the standard with that tooling, apply it to new topics first, and migrate existing topics only where the benefit justifies the work, for example high-volume topics where binary encoding saves real money.

Step throughDeciding and rolling out the format
  1. Gather criterialanguages, tooling, size, readability, existing data
  2. Compare formats against themwith numbers from our own events
  3. Choose a default and allowed exceptionsrecord it in an ADR
  4. Set compatibility default and breaking-change process
  5. Pilot with 2-3 teamsbuild codegen, starter and test tools
  6. Mandate for new topicsmigrate old ones where it pays

6 steps in order. Play them, or step through them one at a time.

7Follow-up questions

Isn't JSON good enough if we add a schema registry?

For low-volume topics, often yes. For high-volume ones, the size and parsing cost add up, and JSON Schema's compatibility checks give weaker guarantees because of open content models. The registry helps a lot, but the format still matters for cost and evolution safety.

How do you measure payload savings to support the decision?

Take a day of real events from a few busy topics, encode them in each format, and compare sizes with and without compression. Compression narrows the gap considerably, so the measurement prevents both overestimating and underestimating the benefit.

What if two large departments disagree?

Bring it back to the criteria and the data from the pilot, and accept a reasoned exception where the criteria truly differ, for example partner topics. A decision with a documented exception is better than a forced standard that one department works around.

8Conclusion

In this answer, we decided between Avro, Protobuf and JSON Schema from criteria: language support, tooling, payload size, readability and existing data. Avro and Protobuf give compact encoding and strong evolution rules, while JSON Schema is readable but larger and weaker in compatibility checking. We set a default compatibility mode such as BACKWARD or BACKWARD_TRANSITIVE and a process for breaking changes, treated schemas as public APIs with owners and review, and piloted with a few teams and real tooling before making the standard mandatory.

What to say in the interviewAbout 90 seconds aloud

Open with

I'd start from criteria rather than a favourite format: which languages our teams use and how good code generation is in each, what tooling we have around the registry and the warehouse, how big and frequent our events are, whether people need to read them directly, and what's already in Kafka.

Then, if they want more

Then I'd compare. Avro and Protobuf are both compact binary formats with clear evolution rules. Avro relies on the registry for the writer schema and handles defaults and aliases well, and it fits the Java and analytics world. Protobuf uses field numbers, has excellent multi-language support and fits if we already use gRPC.

JSON Schema is readable, but payloads are larger and its compatibility checks are weaker in practice because of open content models. I'd pick one default, maybe allow one justified exception like JSON for partner topics, and record the decision.

Then the compatibility rules: a default of BACKWARD, or BACKWARD_TRANSITIVE for long retention, and a written process for breaking changes, which means a new topic or subject with dual publishing rather than turning checks off. Schemas would be treated as public APIs with owners, documentation and reviewed changes through CI.

And before mandating anything, I'd pilot with two or three teams and ship the tooling, codegen plugins, a Spring Boot starter and test helpers, so following the standard is the easy path.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Should your organisation standardise on Avro, Protobuf or JSON Schema for Kafka events...": https://scrivio-interview-library.netlify.app/spring-boot/kafka/734090797f/