Software Architecture · Data & Caching
CQRS and Event Sourcing
Separating writes from reads and replaying history.
1 min readPublished Updated
- cqrs
- event sourcing
CQRS separates the model used to write data from the model used to read it.
ts
type Command = { type: "PublishArticle"; articleId: string };
type Event = { type: "ArticlePublished"; articleId: string; at: string };Event sourcing takes this further by storing the sequence of events as the source of truth, deriving current state by replay.