A practical guide to implementing snapshots in Marten, a .NET event sourcing library. Covers the built-in one-liner snapshot configuration using inline and async projection lifecycles, then demonstrates a more nuanced approach: taking snapshots only at meaningful domain boundaries (e.g., opening a new billing month) rather than after every event. Includes a FinancialAccount example with a repository pattern that loads the latest snapshot and applies only subsequent events, avoiding redundant reprocessing. Warns that snapshots should be a last resort for performance optimization, not a default strategy.

4m read timeFrom event-driven.io
Post cover image