I don't see the difference between the Inbox pattern and the Outbox pattern.
the Inbox pattern saves messages in a database. The Outbox pattern too, so what is the difference?
Actually it's very good question.
There are some differences which we should take consider. For first we got 3 approaches to delivery messages:
Outbox pattern and inbox pattern descirbes "at least once" strategy. Let's have a look for real live example when You got API-one, message broker and API-two, so two microservices with message broker.
What is a problem here? If entity will be saved to DB and for some reason after that BUT BEFORE send event your api will die, API-two will be not informed about that operation, and Your data will be inconsistent.
Outbox pattern:
Inbox pattern
In inbox pattern situation is little bit different but very similar
To sum up - Outbox pattern - You store events into DB of API-one Inbox patter - You store events into DB of API-two
Main difference is that Outbox is for OUTCOME and Income is for processing incoming messages
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With