How Sourcery Compares
Sourcery borrows inspiration from projects like
eventually and
cqrs but makes different trade-offs.
| Area | Typical ES/CQRS libraries | Sourcery |
|---|---|---|
| Event modelling | Events are enum variants tied to one aggregate | Events are standalone structs, reusable across aggregates |
| Projections | Coupled to a specific aggregate enum | Decoupled — subscribe to event types from any aggregate |
| Metadata | Often embedded in event payloads | Carried alongside events in the envelope; domain types stay pure |
| Infrastructure | Bundled command bus, outbox, saga orchestrator | Minimal — repository + store only; you add what you need |
| Event versioning | Explicit upcaster pipelines | Serde attributes on event structs (details) |
| Concurrency control | Runtime configuration | Type-level — Optimistic vs Unchecked (details) |
See Design Decisions for the full rationale behind each choice.