Event sourcing works nicely with aggregates from Domain driven design.

An aggregate has the responsibility of creating immutable events, command handlers that emit these events and validate them too.

Besides creating these events, they can be instantiated and create a state from consuming this history of events, or in other words “applying these events” with event handlers.

Reference

Hoffman, Kevin. Real-World Event Sourcing: Distribute, Evolve, and Scale Your Elixir Applications. The Pragmatic Bookshelf, 2025. The Pragmatic Programmers.

Highlights or timestamps

Real-World Event Sourcing

Transclude of 1756163751-real-world-event-sourcing#^000009
Transclude of 1756163751-real-world-event-sourcing#^000012
Transclude of 1756163751-real-world-event-sourcing#^000013
Transclude of 1756163751-real-world-event-sourcing#^000014
Transclude of 1756163751-real-world-event-sourcing#^000015