The Command Query Responsibility Segregation (CQRS) pattern is critical for designing cloud-native systems that are composed of bounded, isolated, and autonomous services with appropriate bulkheads to limit the blast radius when a service experiences an outage. These bulkheads are implemented by creating materialized views in downstream services.
Upstream services are responsible for the commands that write data using the Event Sourcing pattern. Downstream services take responsibility for their own queries by creating materialized views that are specifically tailored to their needs. This replication of data increases scalability, reduces latency, and allows services to be completely autonomous and function even when upstream source services are unavailable. In this recipe, we will implement a materialized view in AWS DynamoDB.
...