Building a multi-region serverless application with AWS Lambda and strategizing DR
There are numerous strategies used for serverless backend deployment. This article is focused on designing a reliable system to automatically deploy large-sized Lambda functions in multiple AWS regions and planning?disaster recovery in a separate AWS account leveraging the Amazon S3 replication, IAM policies and build tools for seamless integration.
Challenges:
There could be challenges faced especially when you have a large serverless backend.
1. Lambda Function Quota Limit
When you want to deploy the Lambda function to AWS, there will be a point where you’ll get hit by the size exceeding error. The error occurs because AWS imposes a certain limit and quota for the Lambda deployment package. As of now AWS allows about 50MB for zipped + direct upload, and 250MB for uncompressed packages.
?
2. Version Control & CI/CD Workflow
Packaging and deploying your function and its dependencies with AWS Lambda can sometimes be a tedious job. Let’s say you also want to make use of source code management platforms like CodeCommit or GitHub to develop your code before deploying it as an AWS Lambda function.
Since in this scenario Lambda package is large it can’t be deployed directly as a back-end service after the CodeBuild builds it into a zip/bundle/image; rather the CodeBuild service first needs to push this build into some sort of storage service which easily integrates with CodeBuild at one end and serverless services such as Lambda and API gateway at the other
?
3. Managing Multi-Region Setup
High availability is the main reason for deploying to more than one region. Also to reduce latency, you may want to go for multi-region deployments.?In some cases, there?are compliance reasons. The requirement is to store the data in a specific geographical location. Certain types of data are not supposed to cross state borders. In those cases you may have to deploy the lambda function in more than one region.
Although this article advocates strongly for keeping Lambda back-end code in a storage (S3 to be precise), doing this will make the Lambda back-end limited to that very region in which the S3 bucket stores it. So there is a need to make it multi-regional deployment.
?
4. Disaster Recovery
Your workload must perform its intended function correctly and consistently. To achieve this, you must architect for resiliency.
Disaster recovery (DR) is an important part of your resiliency strategy and concerns with how your workload responds when a disaster strikes This response must be based on your organization’s business objectives which specify your workload’s strategy for avoiding loss of data, known as the?Recovery Point Objective (RPO), and reducing downtime where your workload is not available for use, known as the?Recovery Time Objective (RTO).
Solution Overview:
In order to overcome the above-listed problems, we propose the solutions here.
Read the complete article to know more!
Don't forget to share your thoughts on the same.
Follow Comprinno for more insightful articles!
Read the complete article here to know more: https://comprinno.net/building-a-multi-region-serverless-application-with-aws-lambda-and-strategizing-dr/