Microservices in CQRS

The CQRS pattern can be realized through Microservices:

  • The command store and command queue can be built through a Reliable Stateful Microservice. The service can forward the commands to appropriate command handlers. The command store can also be modelled as a Azure SQL database or as a Cosmos DB, whereas the command queue can be modelled as an Azure storage queue, a service bus queue or as a topic with a stateless reliable service acting as a broker between the two storages.
  • The command handlers can be a separate Microservice. Each Microservices can handle the commands with its own logic.
  • The query handler can be modelled as a separate Microservices. The command handler induces changes in the storage that the query handler queries on. These changes can be written to the read database by replicating the data written by the commands to the write database or by raising events using the Event Sourcing pattern.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset