イベント駆動型アーキテクチャ (EDA) は、コンポーネントが直接呼び出しではなく、イベント (起きたこと) を生成し、それに反応することで通信する設計です。疎結合、スケーラビリティ、応答性を実現し、モダンな分散システムで一般的です。
イベント駆動型アーキテクチャとは
Components communicate via EVENTS (a notification that something happened):
→ PRODUCERS emit events ("order placed", "user signed up") without knowing who handles them
→ CONSUMERS react to events they care about (asynchronously)
→ an event BROKER/bus (Kafka, message queue) routes events
→ components are DECOUPLED → they react to events, not call each other directly.
パターンと利点
PATTERNS:
→ PUB/SUB → publish events; multiple subscribers react
→ EVENT STREAMING (Kafka) → durable event logs; consumers process streams
→ EVENT SOURCING → store state as a sequence of events (the events ARE the source of truth)
→ CQRS → separate read/write models, often event-driven
BENEFITS:
✓ LOOSE COUPLING → producers/consumers independent (add consumers without changing producers)
✓ SCALABILITY → async, distribute load; consumers scale independently
✓ RESPONSIVENESS → react to events in real time; extensible (new consumers for new needs)
✓ RESILIENCE → events buffered; components fail independently
