Implementing event sourcing
When you consider documents in a document store and records in a database, these are normally a business’s point of truth. Their state is the source of truth.
Event sourcing record events become your source of truth rather than the state of data in tables, or the state of documents in document stores.
So, instead of using the state as a point of truth, we can use recorded events as a source of truth.
In the old days of programming, this was known as an audit trail. I remember working on a database several years ago. It had an audit table. In that table, there was a record of all the actions that were carried out on the database and by whom. We could tell when data operations took place, what those data operations were, and who or what process was carried out those data operations. Then, if anything went wrong with the database, we could analyze that table and know which operation caused the resulting problems. To store this information,...