Event Sourcing
Event Sourcing is a data management pattern, and its origin can be traced back to the 1990s, when engineers recognized the limitations of traditional data storage Create, Read, Update, and Delete (CRUD), particularly in the context of building complex and event-driven systems.
Event Sourcing has its roots in the principles of Domain-Driven Design (DDD), as covered in Chapter 8. DDD introduced the concept of an Aggregate as a fundamental building block of the domain model, and Aggregates usually need to be persisted in data storage.
The classic CRUD approach and its limitations
The classic CRUD approach is sufficient for capturing the latest snapshot of an Aggregate by CRUD operations, usually with the use of a relational database. There are, however, limitations to this approach:
- History, auditability, and traceability: While the CRUD approach can capture the current snapshot of an Aggregate, its ability to keep audit trails of all changes made to the...