Search code examples
domain-driven-designmicroservicescqrsonion-architecture

How to implement infrastructure Service in Cqrs Architecture?


I intend to implement Infrastructure services in a project that uses the CQRS architecture. The key point is that we are going to cache the Infrastructure service data in this project. And finally, use this data in command and also for the query. And in the end how should I implement this Infrastructure service in the project?


Solution

  • The answer to your question is not simply a question of how to build a class but rather how to build a background service that handles events (via message queues) that loads data to your read database which is consumed by your read API.

    You might want to give a read about Reactors and CQRS