|
|
|
|
|
by saxenaabhi
248 days ago
|
|
> INSERT INTO events (account_id, type, amount, timestamp)
VALUES (123, 'deposit', 100, NOW()) How would it work if they had to support intra system transfers? So one user balance should be withdrawn and another should get a deposit? That's not possible to do atomically with event sourcing right? |
|
In this case it’s XTransactionStarted, XTransactionDepositConfirmed, and XTransactionCreditConfirmed or something along those lines. External interactions tend to follow that kind of pattern where it tracks success/failure in the domain events.
The command side of CQRS tends to be the services that guarantee ordered events either via the backing database or with master-slave topology.