A Rust framework for building event-sourced systems with CQRS patterns.
Epoch is an opinionated event sourcing framework that prioritizes simplicity and performance. The core idea:
Aggregates are living snapshots. State is persisted immediately after every command — no event replay on reads, no snapshot management. Events are still stored for audit, projections, and history.
[dependencies]
epoch = { version = "0.1", features = ["derive", "postgres"] }derive(default) — Proc macros for event data and enum subsettingin-memory— In-memory event store and bus for testingpostgres— PostgreSQL-backed event store and bus
| Crate | Purpose |
|---|---|
epoch |
Main crate, re-exports with feature flags |
epoch_core |
Core traits and abstractions |
epoch_derive |
Proc macros (EventData, subset_enum) |
epoch_mem |
In-memory implementations (testing) |
epoch_pg |
PostgreSQL implementations (production) |
hello-world.rs— Basic aggregate and projection usagesaga-order-fulfillment.rs— Multi-aggregate saga coordinationevent-correlation-causation.rs— Event correlation and causation tracking
- Guide — Architecture, patterns, and design decisions
LGPL-3.0-or-later