Are you considering Event Sourcing? Think again. by Eduardo Bellani
Are you considering doing event sourcing? Maybe you have read that it is necessary for your project or that you will have great benefits in doing so.
If so, I ask you to think about an alternative. Maybe you already have something of equal capacity in the tooling that you use and could extract all the benefits for a fraction of the cost. What is that something? Your old SQL RDBMS (MySQL, PostgreSQL, SQL Server, Oracle, etc).
Here is the kicker: Temporal tables! Most SQL DBMSes already implement
such feature(Jungwirth 2019), and they basically allow
you to reap all the benefits of ES while still keeping to your CRUD
style of programming(Esposito 2017). Think
continuation passing style, but with an async/await
syntax that allows
you think linearly.
To demonstrate the point, here is a table with the claimed benefits from each approach, from the vendors themselves(slightly reworded for space eficiency)(Team 2024; Microsoft 2024):
Temporal Tables | Event Sourcing | Meaning |
---|---|---|
Auditing | Auditing | An immutable audit trail |
Recovering from application errors | Testing & RCA | Improving debugging by having ‘what if’ scenarios |
Calculating trends | Analytics Capabilities | Temporal queries to see your past beliefs |
Reconstructing data | Zero data loss | All state is preserved |