Migrating to Aws Serverless Arch
If you’re keeping up with my projects, you probably know that I tried to run an experiment using some very cheap virtual private servers from a discount provider to approximate the availability that could be obtained. Unfortunately, I decided to scrap the experiment and try something new.
The new requirements
The research portion of my migration was fairly quick. After making the decision to move my site, I had to figure out exactly what I was going to migrate to and how I was going to accomplish it. In the past I’ve used a single dedicated host, which seemed to work well and ported nicely to the VPS experiment. Given that my domain was and would remain hosted on AWS:R53, I knew that I wanted to try some combination of AWS services. I had to have the capability for dynamic content even though a good majority of my site is static. I also didn’t want to completely redesign or develop my site. I began looking for deployment methods for python/flask on AWS. The first deployment patterns I saw used Elastic Beanstalk and RDS which I felt was overkill for my simple site. The next good result I landed on was Zappa.
The migration process
The biggest challenge in migrating my site was preparing my python/flask code for Zappa deployment. I went through the Zappa install/config which takes a minute to integrate with existing projects. After that I spent a few hours deploying new copies, testing all pages/links, and looking at logs to troubleshoot issues with my code. At the end of the night, I had a working site using AWS:Lambda and API gateway that could be deployed, updated, and torn down with a few commands.
After thoughts
So far I haven’t run into any issues with this new development and deployment mechanism. Here are a few points I’d like to call out:
- Cost per month is about the same between this serverless architecture and the VPS experiment though the serverless model is on-going and can increase if I ever see a significant amount of requests.
- The development and deployment is significantly easier/faster than my previous methods. I also now have the ability to deploy multiple projects and environments.
- HTTPS certs are really easy to integrate to your site using Zappa