What is Event Sourcing?

Using persisted events as the source of truth for your business logic is called event sourcing and our API makes building systems based on that pattern simple and fast.

What is an aggregate?

An aggregate is a consistency boundary that typically represents a business object. Changes to an aggregate must be performed atomically and one at a time.

Each change to an aggregate is represented by a business event that is stored in an append-only fashion. The current state of any given aggregate is the sum of all changes in the same way your current bank account balance is the sum of all previous deposits and withdrawals.

Non-destructive updates

By only appending and never actually modifying previously stored data, all changes are in fact non-destructive and leads to a situation where we never have to risk losing possibly important historical information.

How do I revert or undo an event?

To handle cases when something has mistakenly been changed, you have to save a new compensating event that changes the aggregate back to its previous state. In extreme situations you might want to delete entire aggregates or all aggregates for a specific type. Read about the details here.

Time travel

Since all events are stored since the beginning of time, we also have a possibility to look back in history, and by doing so, answer the question why the object was in a particular state at any given time.