Event Sourcing + CQRS

Commands mutate in-memory grain state; one ConfirmEvents transaction persists the batch; reads hit a materialized projection, never the event log

Event Sourcing + CQRS Commands mutate in-memory grain state; one ConfirmEvents transaction persists the batch; reads hit a materialized projection, never the event log 01 / Commands 02 / Write model 03 / Persist 04 / Read model 05 / Queries API / Admin UI · start, complete, signal · 01 / Commands · command API / Admin UI start, complete, signal command WorkflowInstance · in-memory state · 02 / Write model · JournaledGrain WorkflowInstance in-memory state JournaledGrain Event log · FleanCommandDbContext · 03 / Persist · append-only Event log FleanCommandDbContext append-only State projection · EfCoreWorkflowStateProjection · 03 / Persist · after each batch State projection EfCoreWorkflowStateProjection after each batch Read model · denormalized snapshot · 04 / Read model · materialized Read model denormalized snapshot materialized FleanQueryDbContext · NoTracking reads · 04 / Read model · replica optional FleanQueryDbContext NoTracking reads replica optional Admin UI / GET state · /instances/{id}/state · 05 / Queries · query Admin UI / GET state /instances/{id}/state query command ConfirmEvents 1 transaction confirmed state upsert read query Legend primary data data store data flow