Hi there,
I was wondering if it’s possible to create cross-aggregate transactions in Event Store. For example, if a user of a bank system wants to transfer money to someone else’s account. I can imagine that such an operation is implemented in the following way: A MoneySent event with the negative amount of money is added to the sender’s stream, and a MoneyRecieved event is added to the recipient’s stream. Is it possible to create those two events with a single transactional request? I saw that ES supports batch writes but I’m not sure if they will work since those two events won’t be part of the same stream.
Another possible implementation will be to create a single event representing the money transfer and references the sender and recipient. This approach won’t have the transaction issue but seems a little bit wrong to me, mainly because I can’t see which of the streams, the new event should be added to.
What would be the right approach in this situation? And what is the usual approach in event sourcing when it comes to similar issues?
Thanks,
Stan