Event-Driven: The Broker as the Backbone

Event-Driven: The Broker as the Backbone An architecture diagram generated by Archify. Checkout · Call chain: one slow hop takes checkout down Checkout Inventory · Call chain: one slow hop takes checkout down Inventory Pricing · Call chain: one slow hop takes checkout down Pricing Loyalty · Call chain: one slow hop takes checkout down Loyalty Notification · Call chain: one slow hop takes checkout down Notification Checkout · publishes a fact · Published fact: checkout does not know who listens Checkout publishes a fact Broker · the backbone · Published fact: checkout does not know who listens Broker the backbone Inventory · Published fact: checkout does not know who listens Inventory Loyalty · Published fact: checkout does not know who listens Loyalty Notification · Published fact: checkout does not know who listens Notification The Next Consumer · added without touching checkout · Published fact: checkout does not know who listens The Next Consumer added without touching checkout OrderPlaced Call chain: one slow hop takes checkout down Published fact: checkout does not know who listens Legend Backend Message bus External

What inverts

  • • Services publish facts about what happened
  • • Anyone who cares subscribes
  • • Adding a consumer requires no change to the producer

What you give up

  • • Choreography scales in the writing and fails in the reading
  • • No single place tells you what the process is
  • • Ordering, duplicates and replay become your problem

What you must operate

  • • Retry with backoff, then a dead-letter queue
  • • Someone decides: fix and replay, or accept the loss
  • • The broker is now a tier-0 dependency