Event-sourced CQRS for .NET

Focus on your business rules. FCQRS handles the rest.

The rest: event storage, recovery, projections, sagas, and correlation-based read-your-writes.

Start with two pure domain functions, then learn where storage, recovery, and distributed boundaries matter.

First-class support for C# and F#
dotnet add package FCQRSthen follow the learning path
The core domain functions
1decide
let decide cmd state : EventAction<Event>

Validate, decide, and emit events.

2fold
let fold event state : State

Evolve state from events.

Open source on GitHub Built on Akka.NET First-class F# & C# See a full app →

How a request becomes a query result

Command

A request to change one aggregate.

1

decide

Choose an event from the command and current state.

Events

Immutable facts appended to the journal.

2fold

Applies events to aggregate state, live and during replay.

Projections

Update read models asynchronously: the views your application queries.

Runtime responsibilities

Durable journal

Persisted events rebuild aggregate state after restart.

Sagas

Stored workflow state coordinates commands across aggregates.

Recovery

Aggregates and sagas replay stored history before processing.

Read-your-writes

Wait for a selected projection before querying its view.

Snapshots

Capture state for faster replay and recovery.

Also built in Telemetry & health signals Structured logging

Why this matters

Reliable by default

  • Commands are serialized per aggregate
  • Stored events are replayable history
  • Saga progress survives process restart
  • Projection completion can be awaited
  • Snapshots shorten aggregate replay

Ready when you grow

  • Read models are shaped per query
  • Cluster sharding routes aggregate ids
  • Built on Akka.NET
  • Aggregates can run across cluster nodes
  • Storage and projections remain explicit choices

Focus on your domain

  • Business decisions live in decide
  • Recovery logic lives in fold
  • Testable without a runtime
  • Commands and events document outcomes
  • Infrastructure boundaries stay visible