DEV Community

Cover image for How we deployed 9 years old project to AWS Lambda
Yehor Herasymchuk
Yehor Herasymchuk

Posted on

How we deployed 9 years old project to AWS Lambda

It was the most challenging task for me since we migrated to AWS in 2020. It took more than 3 months to migrate completely.

And here are 7 parts of my checklist and working plan how to do this without downtime and crashes.

1️⃣Part 1. Development and QA

(November - December)

  1. Clean code from large files
  2. Remove all unnecessary js/images/css
  3. Optimize page speed
  4. Configure dockerfile
  5. Prepare stage environment
  6. Verify on test data that everything is working
  7. Fix bugs

2️⃣Part 2. Pre-Production:

02.01-18.01.2023

  1. Prepare preproduction (same data but different urls)
  2. Disable queues/scheduler for pre production (to prevent problems with data - data
  3. Verify on real data that
  4. Fix issues

3️⃣Part 3. Deploy code

17.01.2023

  1. Deploy New code to old servers
  2. Verify everything is working
  3. Monitor full day and fix issues

4️⃣Part 4. Deploy Queues Workers and Scheduler the production

18.01.2023

  1. Reconfigure queues to push to SQS (on old servers)
  2. Deploy only queues workers and scheduler on Vapor
  3. Stop old Redis queues workers (on old servers)
  4. Verify everything is working
  5. Monitor logs : Full day

5️⃣Part 5. Deploy http: internal api and accounts management

19.01 (Friday 🤯)

  1. Reconfigure preproduction domains in Vapor to production
  2. Change DNS Cname on Cloudflare
  3. Verify everything is working
  4. Monitor load and logs full day + weekends

6️⃣Part 6. Deploy admin (orders monitoring + content management system)

24.01.2023

  1. Reconfigure preproduction domains in Vapor to production
  2. Change DNS Cname on Cloudflare
  3. Verify everything is working
  4. Monitor load and logs full day

7️⃣Part 7. Monitoring and optimization

24.01-01.02

  1. Optimize order monitoring pages: reduce html volume(lambda limit - 5mb per page)
  2. Optimize archive statistics reports - lambda limit - 30 seconds timeout
  3. Monitor load

It is just a quick overview of what was done, and there were a lot of challenges on each step. 5 and 6 were the easiest one. And 4 was the most stressful for me since it was tremendous change of architecture and there wasn’t chance for mistakes.

Despite of overwhelming count of challenges it was one of the most valuable contribution in the Dots architecture and future development. Therefore, I can tell a lot of Stories about difficulties and there solutions.

All in all, good team work helped us to find all issues before they went live. And a good plan ensured to deploy with minimal risks.

Top comments (1)

Collapse
 
yehorherasymchuk profile image
Yehor Herasymchuk

Feel free to ask me about migration to AWS Lambda