The Real Fullstack

The Missing Event

The order is in the database. Why was it never shipped?

Senior Engineer10 Min.FlusssimulatorCode-Aufgabe
kafkapostgresqlspring-bootdebeziumjava

Diese Aufgabe ist noch nicht auf Deutsch übersetzt. Du liest die englische Version.

Mission:Reproduce the lost event, then make the database write and the event consistent under every combination of crashes, rollbacks, broker outages and relay restarts.Kontext · Lernziele ▾

Brightcart's order service saves an order, then publishes OrderPlaced to Kafka for shipping. Every week a few orders are never shipped. They all coincide with deployments or short broker outages. An earlier attempt to publish inside the transaction created shipments for orders that didn't exist.

Mission: Reproduce the lost event, then make the database write and the event consistent under every combination of crashes, rollbacks, broker outages and relay restarts.

Lernziele

  • Explain the dual-write problem between a database and a broker.
  • Implement the transactional outbox.
  • Pair at-least-once publishing with idempotent consumers.
SimulationSimuliert
Order serviceOrders DBOutbox relayorders topicShipping
Simulation starten

Starte die Simulation, um die Ausgabe zu sehen.

Vereinfachung

Four failure points; each happens at most once. Real relays also need ordering per aggregate and cleanup of sent rows. Lernmodell – die Zahlen veranschaulichen Verhalten und sind keine Benchmarks.

Konzepte

Hilfreich vorher

Verwandte Aufgaben

Referenzen