Jump to a problem, path or page
Jump to a problem, path or page
01 · Frame the problem
Design a registry for a deliberately restricted record-schema language. Producers register schemas before publishing events. Compatibility depends on which reader must understand which writer, not just whether two JSON documents look similar.
A schema version has immutable meaning, while compatibility depends on the declared reader/writer direction. Concurrent registrations must validate against the same authoritative predecessor instead of independently approving incompatible futures.
02 · Find the design pressure
Begin with canonical schema identity and subject history. A generic JSON equality check cannot prove compatibility. Restrict supported semantics, define direction explicitly and serialize registration using the subject's expected version.
03 · Define success
Workload: 20,000 reads/s, 100 writes/s, 1000 B records, 150 ms read p99 target. These are exercise assumptions; the Solution includes capacity formulas.
04 · Identify the correctness boundary
Canonicalize schemas before identity comparison and evaluate compatibility against the documented reader/writer model. Registration must compare the subject's expected version so concurrent candidates cannot both validate against an outdated base. Immutable historical versions remain available to decode existing messages.
05 · Make it concrete
Versions 4A and 4B both validate against subject version 3. Only one conditional registration becomes version 4; the other reloads and revalidates. Compatibility checks apply in the declared direction: a new reader accepting old data does not automatically mean old readers accept new data.