SlideShare a Scribd company logo
Implementing
Outbox*
Tomek Masternak
* model-checking first
2PC is no
longer
to the rescue
Welcome to
the land of
anomalies
What should we expect?
3 2 1
send order
3 2 1
2
1
3 2
3 3 1
2 2
processing order
duplication
re-ordering
duplication
re-ordering
No single
solution
Hero is here
Outbox in action
Transport transaction
Data store transaction
Publish
Edge cases
Model-checking
vs
automanual tests
TLA+: Temporal logic of actions
S0
S1
S2
S3
A1
A2
A3
A4
A5
…
…
…
Invariants*
+
*and more
In practice more like this
https://www3.hhu.de/stups/prob/index.php/File:CANBus_sfdp.png
What makes a
good model?
Demo 0:
Toolbox
Demo 1:
Ghost
messages
Demo 2:
Lost messages
Demo 3:
No duplicated
processing
Demo 4:
Consistent
output
Questions?

More Related Content

PPTX
MATLAB Programming - Loop Control Part 2
PDF
Concurrency in Distributed Systems : Leslie Lamport papers
PPTX
Banner Grabbing
PPTX
Semophores and it's types
PPTX
Semaphore
PPT
Semaphores and Monitors
PDF
Zeromq anatomy & jeromq
PPTX
Phasers to stunning
MATLAB Programming - Loop Control Part 2
Concurrency in Distributed Systems : Leslie Lamport papers
Banner Grabbing
Semophores and it's types
Semaphore
Semaphores and Monitors
Zeromq anatomy & jeromq
Phasers to stunning

More from Particular Software (20)

PDF
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
PDF
Beyond simple benchmarks—a practical guide to optimizing code
PDF
An exception occurred - Please try again
PPTX
Tales from the trenches creating complex distributed systems
PPTX
Got the time?
PPTX
Reports from the field azure functions in practice
PPTX
Finding your service boundaries - a practical guide
PPTX
Decomposing .NET Monoliths with NServiceBus and Docker
PDF
DIY Async Message Pump: Lessons from the trenches
PDF
Share the insight of ServiceInsight
PPTX
What to consider when monitoring microservices
PPTX
Making communications across boundaries simple with NServiceBus
PPTX
Making communication across boundaries simple with Azure Service Bus
PPTX
How to avoid microservice pitfalls
PDF
Connect front end to back end using SignalR and Messaging
PDF
Async/Await: NServiceBus v6 API Update
PDF
Async/Await: TPL & Message Pumps
PDF
Async/Await Best Practices
PPTX
Making workflow implementation easy with CQRS
PPTX
Cqrs but different
Scaling for Success: Lessons from handling peak loads on Azure with NServiceBus
Beyond simple benchmarks—a practical guide to optimizing code
An exception occurred - Please try again
Tales from the trenches creating complex distributed systems
Got the time?
Reports from the field azure functions in practice
Finding your service boundaries - a practical guide
Decomposing .NET Monoliths with NServiceBus and Docker
DIY Async Message Pump: Lessons from the trenches
Share the insight of ServiceInsight
What to consider when monitoring microservices
Making communications across boundaries simple with NServiceBus
Making communication across boundaries simple with Azure Service Bus
How to avoid microservice pitfalls
Connect front end to back end using SignalR and Messaging
Async/Await: NServiceBus v6 API Update
Async/Await: TPL & Message Pumps
Async/Await Best Practices
Making workflow implementation easy with CQRS
Cqrs but different
Ad

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Programs and apps: productivity, graphics, security and other tools
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
A comparative analysis of optical character recognition models for extracting...
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
MYSQL Presentation for SQL database connectivity
Digital-Transformation-Roadmap-for-Companies.pptx
Ad

Implementing outbox model-checking first

Editor's Notes

  • #2: Hi everyone, my name is Tomek and in this talk I’ll be talking about `Checking safety in Exactly-Once`
  • #5: At-least-once message delivery Concurrent message receives Add an animation showing send-order and possible anomalies one by one
  • #8: graph LR   receiveMessage(1. Receive)   dedupe{2. Deduplication}   handler(3. Execute handler)   storeOutbox(4. Store outgoing<br/>messages in outbox)   commitStore(5. Commit<br/>to store)   areSent{6. Have outgoing<br/>messages been<br/>sent?}   send(7. Send messages)   updateOutbox(8. Set as sent)   ack(9. Ack)   receiveMessage-->dedupe   dedupe-- No record found -->handler   handler-->storeOutbox   storeOutbox-->commitStore   commitStore-->areSent   send-->updateOutbox   updateOutbox-->ack   dedupe-- Record found -->areSent   areSent-- No -->send   areSent-- Yes -->ack
  • #14: What are the files? What are the parts of the specification?