Discussion about this post

User's avatar
Olek Gornostal's avatar

And a second question: let's say a store credits ledger is implemented as a separate sub-system, what challenges do you see in using eventual consistency in the purchase flow?

One approach might be logging a payment intent in the database and processing the transaction asynchronously. If something fails, appropriate rollbacks would be applied. Kind of like a Saga with orchestration, but without extra complexity: without changing the downstream services or building Saga middlewares.

Expand full comment
Olek Gornostal's avatar

Thanks for the interesting read, as always!

I'm curious why a payment system isn't designed to avoid the need for complex distributed transactions? Such an approach could enhance cohesion and maintainability. A ledger with store credits could be implemented in the same service, as payments and store credits are inherently linked and share similar architectural characteristics. By separating them into distinct entities, we might gain no real advantage. Am I missing something?

Expand full comment
4 more comments...

No posts