Title
AWS re:Invent 2022 - Lift and shift a web application to serverless: Yes, it’s possible! (BOA326)
Summary
- Marce Vizalba, a developer advocate for the Serverless team, and Danilo, from the Developer Relations team, share their experience of lifting and shifting a web application to serverless.
- Marce recounts an initial challenging migration to serverless in 2016, which took nine months and faced issues upon deployment.
- They discuss the Strangler pattern, which involves migrating an application piece by piece, but for their use case, a lift and shift approach was deemed more suitable.
- The session covers strategies for migrating a backend, frontend, and database to serverless with minimal code changes.
- They address common migration problems, cost, and performance, with Marce accepting the challenge to make a serverless web application perform as well as a non-serverless environment.
- The application in question is an e-commerce platform using MongoDB, Node.js with Express for the backend, and React for the frontend.
- Migration requirements include scalability, minimal infrastructure management, and high availability.
- They propose using AWS CDK with TypeScript to automate the architecture implementation.
- MongoDB Atlas is chosen for the database due to its serverless option.
- For the backend, AWS Lambda is selected over Fargate and App Runner because it meets the requirement to scale to zero.
- The AWS Lambda Web Adapter is introduced as a tool to run web applications on Lambda, supporting various programming languages and web frameworks.
Insights
- The lift and shift approach to serverless migration can be a viable strategy when a complete re-platforming is necessary, and the Strangler pattern is not suitable.
- Serverless architectures can offer significant benefits in terms of scalability, infrastructure management, and availability, which are particularly valuable for variable workloads like e-commerce platforms.
- AWS CDK and TypeScript can be powerful tools for automating and managing cloud infrastructure as code, providing a strongly typed language that can help guide the architecture building process.
- MongoDB Atlas's serverless option on AWS allows for a seamless migration of databases with minimal changes, which is crucial for lift and shift strategies.
- The AWS Lambda Web Adapter is a key innovation that enables traditional web applications to run on Lambda without significant code changes, broadening the scope of applications that can benefit from serverless architectures.
- The session demonstrates that with careful planning and the right tools, it is possible to migrate existing web applications to a serverless model while addressing common concerns such as performance and cost.