From Monolith to Microservices in AWS: Patterns for Seamless Migration
Inspired by Monolith to Microservices, this example explains monolith-to-microservices patterns on AWS.
Inspired by Monolith to Microservices: Evolutionary Patterns to Transform Your Monolith, this example explains about Monolith to Microservices in AWS.
Strangler Fig Application
The Strangler Fig Application pattern enables you to migrate functionality incrementally to microservices without requiring disruptive changes to your existing application.
Instead of rewriting the entire monolith in one go, you gradually create new microservices around the existing system. Over time, these services take over the monolith’s responsibilities, allowing for its eventual decommission.
Implementing with AWS ALB
Using an Application Load Balancer (ALB), you can route requests to either the monolith or new microservices. ALB’s path-based routing feature facilitates this routing.
Implementing with SQS
For message processing applications, AWS Lambda can analyze message contents and then enqueue them for processing by the monolith or microservices via SQS.
Parallel Run
The Parallel Run pattern allows you to call both the monolith and microservices simultaneously and store their results separately.
This approach is especially useful for high-risk migrations or major system changes, as it provides a safety net to compare outputs before making the final transition.
Change Data Capture (CDC)
The Change Data Capture (CDC) pattern is another migration strategy, though it comes with significant challenges. As noted by the book’s author:
In general, I try to keep the use of this pattern to a minimum because of the challenges around some of the implementations of this pattern.
AWS supports the CDC pattern via Database Migration Service (DMS) and DynamoDB Streams.
This pattern enables you to reactively handle data changes in source databases, making it ideal for synchronizing data during migration.
Related posts
Sign in with Slack Using Cognito User Pools and OIDC
This note describes how to federate Cognito user pools with Slack using OIDC to implement "Sign in with Slack".
Deploying FastAPI on AWS Lambda with Lambda Web Adapter
This example guides you through the process of developing API backends with FastAPI using Lambda Web Adapter.
API Gateway WebSocket: Implementing a Mock Integration
This note describes how to build an API Gateway WebSocket endpoint using mock integration.
Uploading to S3 Through CloudFront Pre-Signed URLs
CloudFront signed URLs let you upload to S3 through a custom domain—useful when direct S3 pre-signed URLs are not an option.
AWS EventBridge Scheduler: Automate EC2 Scheduling with Ease
This note describes how to automate starting and stopping of EC2 instances using EventBridge Scheduler.
