by candiddevmike · 2y ago · 0 comments
Just store the current state of the code base. You can't have merge conflicts without conflicting commits.
The problem is availability. You have to aggregate those events to get anything meaningful about it and aggregation can be really really slow.
Throw away all invoices and receipts, and just represent each customer's balance as a single number. When it changes, get your crayon, cross it out, and write the new number.
[1] https://en.wikipedia.org/wiki/Command_Query_Responsibility_S...
[2] This Martin Fowler, https://en.wikipedia.org/wiki/Martin_Fowler_(software_engine... not this Martin Fowler https://metro.co.uk/2023/11/06/eastenders-star-reveals-why-m...
If an application allows someone to be able to enter let's say an order number from anywhere in the world from the last 10 years and be able to find the order, there is no magic - some server out there is going to have to scan a huge amount of data to find a match.
Tricks such as indexes, partitioned tables, etc can be employed, but those tricks have nothing to do with event-sourcing and are independent of it.
You might want to use different tricks in different situations. Different situations means different services, and different tricks means different storage/query technologies.
So how do you get your data into three systems - and more crucially - keep them in sync? Webhooks? Triggers? Some bidirectional sync magic app that claims to beat CAP?
Just use event-sourcing (append-only, disallow modification) and the multiple systems will stay in sync as long as they know how to process one more message.