One of the key design philosophies of microservices is the bounded context and the service(s) managing the data store. Within a bounded context, multiple services might have access to a common data store, or adopt a per service data store paradigm.
Since there are potentially multiple instances of a service running, how do we make sure the data read/update operations do not lead to a deadlock in resources?
CQRS introduces an interesting paradigm challenging the conventional thought of using the same data store to create/update and also query the systems. The idea is to separate the commands that change the state of the system from the queries that are idempotent. The materialized view is an example of this pattern. The separation also gives the flexibility to use a different data model for updates and queries. For example, the relational model could be used for updates, but the events generated from the updates...