Controlling access with the CQRS pattern - AWS Prescriptive Guidance

Controlling access with the CQRS pattern

Another pattern that you can use to isolate external systems that connect to this central database is command query responsibility segregation (CQRS). If some of the external systems are connecting to your central database primarily for reads, such as analytics, reporting, or other read-intensive operations, you can create separate read-optimized data stores.

This pattern effectively isolates these external systems from the impacts of database decomposition and schema changes. By maintaining dedicated read replicas or purpose-built data stores for specific query patterns, teams can continue their operations without being affected by changes in the primary database structure. For example, while you decompose your monolithic database, reporting systems can continue to work with their existing data views, and analytical workloads can maintain their current query patterns through dedicated analytical stores. This approach provides technical isolation and enables organizational autonomy because different teams can evolve their systems independently without tight coupling to the primary database's transformation journey.

External system accessing a read replica instead of the monolithic database.

For more information about this pattern and an example of its use to decouple table relationships, see CQRS pattern later in this guide.