top of page
fondo banner oscuro

Tech Glossary

Event sourcing

Event sourcing is a software architecture pattern where changes to the application state are stored as a sequence of events, rather than storing just the current state of an entity. In traditional systems, only the final state of the data is stored in a database, but event sourcing captures every change, allowing for a complete history of how the state evolved over time.

In event sourcing, each change (or event) is immutable and reflects something that happened in the system, such as "order placed," "product added to cart," or "payment received." These events are stored in an event store, and the system can reconstruct the current state by replaying the events from the beginning.

The benefits of event sourcing include auditability, as every state change is logged; scalability, as events can be processed asynchronously; and the ability to "replay" the system to any point in time. It is especially valuable in domains like finance, where a precise historical record is critical.

Event sourcing is often paired with CQRS (Command Query Responsibility Segregation) to separate read and write operations, optimizing performance and scalability.

bottom of page