Re:The Dual Nature of Events in Event-Driven Architecture
by withinboredom on Sunday November 03, 2024 @03:45AM
(#42031888)
It can fail at your commas in 1&2, then you are just as broke as everyone else.
This isn't an easy-to-solve problem when it comes to distributed computing.
Re:The Dual Nature of Events in Event-Driven Architecture
by hcarvalhoalves on Monday November 04, 2024 @08:34AM
(#42041385)
It should be an atomic transaction, double-entry style, so it can’t fail between commas.
The important thing is not having money go missing.
Re:The Dual Nature of Events in Event-Driven Architecture
by withinboredom on Monday November 04, 2024 @01:20PM
(#42044473)
The only way that is possible is if the tables exist on the same database server. Otherwise, you are right back at distributed transaction problems.
Re:The Dual Nature of Events in Event-Driven Architecture
by hcarvalhoalves on Thursday November 07, 2024 @02:15PM
(#42079859)
That's the whole point of double-entry. You don't split the entries.
Re:The Dual Nature of Events in Event-Driven Architecture
by withinboredom on Sunday November 10, 2024 @09:18AM
(#42100353)
Then this is off-topic af. We are talking about distributed systems here.
1. Debit A, Credit in-flight.
2. Credit B, Debit in-flight.
If 1. fails, nothing happened and everything is consistent.
If 2. fails, you know (because you have money left on in-flight), and you can retry later, or refund A.
This way at no point your total balance decreases, so everything is always consistent.