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
