CQRS Architecture Implementation On AWS
CQRS Architecture Implementation On AWS
Implementation on AWS
What is CQRS
- CQRS stands for Command Query Responsibility Segregation
- In the context of .NET, we will create two separate APIs (Write API and
Read API), each with different DbContext
- Data between Write API and Read API can be replicated synchronously or
asynchronously, both has its own advantages and disadvantages.
- The scale of your project does not justify the costs and complexity of
implementing CQRS and multiple databases
- Good performance for Write Queries with DynamoDB, while Aurora/RDS offer
good performance and functionality for Read Queries (complex JOINS, etc.)
Disadvantages:
- Need to ensure the Lambda function which replicates the data in DynamoDB
to Aurora/RDS works correctly.
- Cost
DynamoDB as Write Database,
OpenSearch as Read Database
Aurora/RDS as Write Database, Read
Replicas as Read Database
Aurora/RDS as Write Database, Read
Replicas as Read Database
Benefits:
- Easier to replicate data from the main database to the read replicas
Disadvantages: