Skip to content

Write Side

foreseaz edited this page Sep 11, 2020 · 3 revisions

Aggregates

The Aggregates concept is from DDD (Domain Driven Design), the Commands are executed by objects that encapsulate domain logic and these objects (called Domain Objects) are grouped into Aggregates. In a CQRS app, an aggregate is a transaction boundary, which means that any given aggregate should be able to execute its commands without communicating with other aggregates.

Commands

Command is:

  • A request (imperative sentence)
  • May fail
  • May affect multiple Aggregates

For example: Index Block, Run Cron Job

CMD1 - Index Block

Events

  • Statement of facts that happened (past tense).
  • Never fails.
  • May affect a single Aggregates.

For examples: Block Indexed, Current Block Tx Collected

Reference

Clone this wiki locally