domain-driven-designcqrsevent-sourcinganemic-domain-model

CQRS and Domain Driven Design: Anemic data model for Query side


In a scenario where CQRS and Domain Driven Design approachs are used in conjunction, is it allowed to implement the ‘Query side model’ in an anemic style?

In my opinion:

As a result, I would implements two different models: the ‘rich’ data model, for Command side, in a DDD style and the ‘anemic’ data model, for the Query side.

What DDD suggest about these points? Is there something more to consider?

Thank you


Solution

  • I think you have a valid approach. The query side doesn't need complex models, just simple DTOs to act as containers for the data.

    This idea is supported in .NET Microservices: Architecture for Containerized .NET Applications, top of page 187.