Skip to content

Build queries from more than 1 aggregate #96

Description

@carlos-verdes

If we apply CQRS the commands and queries have different models, and it will be super normal to consume more than one Aggregate event for a single Query.

Simplified example for trading platform:

  • aggregate to manage user portfolio --> allow user to track assets, events like AssetDeposited, AssetWithdrawn, AssetBought, AssetSold
  • aggregate to update prices --> it will register all assets from all users portfolios and every hour will get last price
  • portfolio overview query --> combining the balance of assets of a user (using events from first aggregate) and the update in price (using second aggregate) will show total usd value per portfolio/asset to final user

Related with #94

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions