Explore this system
Step through curated paths without changing the source diagram.
Beat
Next
ReadyChapter 01 / 01
Guided chapter
Diagram guideExplore this system
Inspecting compiled semantics
E ExportT ThemeS Style0 Reset+ Zoom in- Zoom outEsc Close
Find a node
⌕/
No matching nodes
Semantic passport
Verified source
Authored reach
Route probeChoose a start node
Pick two semantic nodes on the diagram
Choose the source, then the destination. Direction matters.
Semantic lensCompare system roles
Choose up to two semantic kinds. One reveals its real traffic; two compare only direct authored relationships.
Choose a kind to inspect its nodes and touching relationships.
Semantic radar
Building overview
Click nodeDrag to pan
Semantic radar needs more MAP space.
Dual write
• Commit the order and then publish, and a crash in the gap leaves an order nobody is ever told about
• Publish first and a rolled back transaction leaves a message about an order that does not exist
• There is no ordering of the two that is safe, because there is no commit that covers both
• XA is the other answer: every participant has to be a transaction manager, it holds locks across a network round trip, and Kafka is not one at all
The outbox row
• The order row and the message row go in on the same connection in the same transaction, so there is one commit and no gap to crash in
• Written after the commit, on a second connection, or into a second database, it is a dual write again with extra steps
• The poll wants an index on the unsent predicate, or it degrades into a growing scan as the table fills
• SKIP LOCKED lets several relays claim different rows at once, and gives up ordering to do it
At least once
• The relay can publish and die before it marks the row sent, so the outbox trades the message you lost for the one you get twice
• The outbox id travels as the message id, which is the thing the consumer has to dedupe on
• The consumer writes that id in the same transaction as its side effect, or the crash has only moved
• A sequence hands out ids before commit, so 8815 can commit first: a poller ordered by id publishes out of order, and one tracking a high water mark skips 8814 outright