Up until this point all of the backend services I have worked on where hosted on either private data centers or virtual machines in public data centers. This blog itself I have been hosting on a virtual machine in Canada with OVH.
I enjoyed the flexibility of having a virtual machine always connected to the Internet. I like experimenting with different frameworks and building different web applications and web services. Whenever I start a new project I would use the same VM to get them online. The obvious downside is that those services are almost never production-ready, therefor one of them would occasionally misbehave and take the whole VM down.
Earlier this year I have started working with AWS. It’s not hard to fall in love with the promises that AWS makes. Reliability, scalability, pay for what you use, stop guessing the demand, and many more. I want to shift my blog to AWS mostly as a learning opportunity. I’d like to understand the benefits and uncover the shortcomings of this decision. So below is the breakdown of the main areas I want to monitor with this change.
I have used the PageSpeed insights the measure the current performance score of the pages. At the moment, it is 46 out of 100 for mobile and 71 out of 100 on Desktop.
My expectation is that I can significantly increase these figures when I move to AWS. My biggest bet is on Edge Locations to deliver cached static content and decoupling the web service from the database.
Maintenance is a bit of a pain point for this blog at the moment. I need to look after the patches and security updates of the underlying operating system,
This is the biggest uncertainty for me at the moment. Running a VM has a very predictable cost. Once I move to AWS the cost will vary based on the usage and it is somewhat hard to estimate the cost ahead of time as each individual service comes with its own fee. Right now I’m paying approximately $12.02 USD per month for the VM. I expect AWS to be significantly more expensive than that.
I use WordPress Jetpack’s Downtime Monitoring to keep an eye on the status of my website. In my experience it hasn’t been super reliable. Occasionally my blog will stop operating and I wouldn’t receive notifications from Jetpack. I expect AWS monitoring tools like CloudWatch to be a lot more reliable.
There is no scalability with my VM at the moment. One time when I decided to scale up by moving to a bigger VM I had to purchase a second instance, set it up from scratch by restoring from my primary VM’s backups, run the two in parallel for a while, then eventually move the DNS records to the new instance once I have made sure that everything is running as I expected. AWS is famous for its automatic virtually unlimited (as long as your budget permits) scale-out tools.
I have simulated a load of 1,000 users on the website using loader.io and it completely took the website down in a matter of seconds. Interestingly enough, once the web server recovered itself, the database didn’t and I needed to manually restart it.
I’m currently using two services to backup my data. I take a manual snapshot of my whole VM and back-up my database and WordPress files using the UpdraftPlus plugin.
Plan of attack
I am planning to migrate the database first to RDS, then I’ll move the blog files into a Docker container running on my VM followed by running it on ECS. Then I’ll look into ways to better integrate my static files with Edge Locations. Hopefully during this time I will also uncover additional optimisation options which I will be experimenting with.
I’m aiming to perform one operation per week followed by a blog posted.