Kafkaはイベント駆動型アーキテクチャの人気のある基盤です。このアーキテクチャでは、サービスが直接呼び出しではなくイベントを通じて通信します。Kafkaの耐久性があり、スケーラブルなイベントログは、イベント駆動型システム、イベントソーシング、CQRSに適しています。
Kafkaをイベントバックボーンとして
In event-driven architecture, services emit and react to EVENTS:
→ a service publishes events to Kafka ("OrderPlaced", "PaymentReceived")
→ other services CONSUME and react (decoupled — the producer doesn't know the consumers)
→ Kafka = the durable, scalable EVENT BACKBONE connecting services
→ services are decoupled, communicating via events through Kafka
なぜKafkaがイベント駆動型システムに適しているのか
✓ DECOUPLING → producers and consumers independent; add consumers without changing producers
✓ DURABLE event LOG → events stored/replayable; new services can read history; reliable
✓ MULTIPLE consumers → many services react to the same events (each group independently)
✓ SCALABLE → handles high event volumes; partitioned for parallelism
✓ ORDERING (per partition/key) → ordered events per entity
