Multi-Region CQRS for On-Premises Monoliths
Publication date: July 1, 2022 (Diagram history)
This architecture shows how to expand your on-premises transactional monolith to the cloud using the AWS global network. You reduce latency for end users around the world while maintaining transactional isolation, using the Command Query Responsibility Segregation (CQRS) and the read-local write-global architectural patterns.
Multi-Region CQRS for On-Premises Monoliths
The following steps describe the architecture:
-
Deploy an AWS Direct Connect connection between your on-premises installations and the nearest AWS Region to ensure low-latency hybrid connectivity.
-
Set up a change data capture (CDC) stream from your on-premises relational database by attaching AWS Database Migration Service (AWS DMS) to the source database. Stream the events with Amazon Kinesis Data Streams.
-
Handle Kinesis CDC events with AWS Lambda, storing them in denormalized Amazon DynamoDB Global Tables.
-
Expose an API to your customers in the Region with Direct Connect (the primary Region), and handle query requests by reading denormalized data in DynamoDB.
-
Handle client command requests by dispatching them to the on-premises monolith service to maintain transactional isolation and atomicity.
-
Expose additional APIs in one or more secondary Regions, serving read requests with data replicated to the local DynamoDB table, and dispatching command requests to the primary Region.
-
Set up Amazon Route 53 monitoring of your Regions in the us-east-1 Region, sending health alarms to Amazon Simple Notification Service.
-
Handle health alarms with Lambda, storing the state and location of Regional APIs in a DynamoDB Global Table.
-
Set up circuit breakers on the API dispatchers based on the state of available Regions in DynamoDB.
Further reading
For additional information, refer to the following resources:
Diagram history
To be notified about updates to this reference architecture diagram, subscribe to the RSS feed.
| Change | Description | Date |
|---|---|---|
Initial publication | Reference architecture diagram first published. | July 1, 2022 |
Note
To subscribe to RSS updates, you must have an RSS plugin enabled for the browser you are using.