Aggregate Event Stream Lifetimes
Explore the differences between short-lived and long-lived aggregates in event-sourced systems. Understand how snapshots improve performance by reducing event loads, and discover strategies for snapshot frequency to efficiently manage event streams in Golang applications.
Types of aggregates
In an event-sourced system, there are two kinds of aggregates:
Short-lived aggregates
Long-lived aggregates
Short-lived aggregates
Short-lived aggregates will not see many events in their short lifetime. Examples of a short-lived aggregate would be Order from the Ordering module and Basket from the Shopping Baskets module. Both exist for a short amount of time, and we do not expect them to see many events.
The performance of short-lived aggregates and streams with few events in general will not be a problem. The small number of events can be read and processed quickly.
Long-lived aggregates
Long-lived aggregates will see many events over their very long lifetime. Examples of long-lived aggregates are Store from the Store Management module and Customer from the ...