Capabilities
Event Sourcing
An append-only PostgreSQL event store: full history, concurrency control, schema evolution, time travel — and the tools to run it for years.
Relay persists aggregates as streams of events rather than rows of current state. The balance isn’t a number in a column — it’s the sum of everything that ever happened, and every “why is this value wrong?” question has an answer.
What ships: the append-only IEventStore over PostgreSQL, event-sourced
repositories, optimistic concurrency with snapshots, an opt-in pessimistic
per-aggregate write lock, versioned serialization with upcasters for schema
evolution, rename-safe [AggregateType] / [EventType] stable names, rich
event metadata (causation, correlation, actor), time-travel / as-of replay,
event archiving and compaction for storage control, crypto-shredding for
GDPR-grade erasure, and forensic operational queries over the log.
The stories behind it: The Case of the Missing $4,000 is the pitch for history; What Did My Balance Say Last Tuesday? is the payoff.
Learn by building
The tutorials for this area, in order — each with a runnable sample.
005Event Sourcing BasicsEvery sample so far stored state: the current product, the current order, the current balance.
006Concurrency & SnapshotsArticle 005's event sourcing works beautifully for a fresh account with three events. Production breaks that idyll two ways.
024Schema Evolution: Upcasters, Stable Names, MigrationsIn an event-sourced system the events are the database, and unlike rows you can never UPDATE them — history is immutable.
027Time-Travel & Live Aggregation: Reading the Past from the StreamEvent sourcing stores the sequence of events that produced an aggregate's state, and the write side rebuilds the current state by replaying that sequence (article 005).
028Pessimistic Per-Aggregate Write LockArticle 006 established Relay's default for concurrent writes to an event-sourced aggregate: optimistic concurrency.
029Rich Event MetadataEvery event Relay appends already carries a little metadata: the CommandName that produced it and a Timestamp.
034Event Archiving & CompactionAn event store is append-only: events are never updated and never deleted, which is exactly what makes it a trustworthy source of truth.
035Crypto-Shredding for the Right to ErasureAn event-sourced system has a property its operators love and its compliance officers fear: the log is immutable and never deletes.