スキーマレジストリは Kafka メッセージのデータスキーマを管理し、イベントデータの構造を定義・強制することで、スキーマの進化を安全に実現します。これはプロデューサーとコンシューマー間のデータ整合性と互換性を確保するために重要です。
問題: メッセージ内のデータ構造
Kafka messages are just bytes → producers and consumers must AGREE on the data structure:
→ without management → producers might change the format, breaking consumers
→ how do consumers know the structure? how do you change it safely?
→ a SCHEMA REGISTRY manages this.
スキーマレジストリの役割
SCHEMA REGISTRY → a central service storing and managing message SCHEMAS:
→ defines the STRUCTURE of message data (fields, types) — e.g. with AVRO, Protobuf, JSON Schema
→ producers/consumers reference schemas (by ID) → consistent serialization/deserialization
→ ENFORCES schemas → validates data conforms; consumers know how to parse messages
→ ensures producers and consumers share a consistent, evolving contract
