This site is now serverless!!

This site is now serverless – well, sort of.

I was paying around $85 per year with hosting on WordPress.com, and now I guess it will be less than $40 per year. I am not really interested in posting a big how to guide on that, but I used the below tools for this setup.

  • VirtualBox
    • Why ?
      • Comparing to other virtualization software for Windows 10 home edition, Virtualbox provides snapshot capability.
    • Why not AWS EC2?
      • The instances are cheap if used only for few hours, but the EBS volumes are not. Wanted to save as much as possible in terms of money.
  • Bitnami WordPress stack.
    • Why ?
      • I was too lazy to install OS, then install WordPress and its dependencies manually. Why would I do it when this is readily available as an .OVA file and I can just import it to Virtualbox
  • WP2Static
    • Why ?
      • This wonderful plugin helps to convert the whole site into static files. This helps me to be able to use the normal WordPress UI to publish posts, and then convert to static code with a push button.
  • WordPress Importer
    • Why?
      • To import my posts and media from existing WordPress.com site.
  • Google Analytics
    • Why?
      • When the site was in WordPress.com I could see my traffic from the WordPress console. Now this is hosted as a static site, I found Google Analytics as the easiest for me to check my traffic.
  • Facebook Comments
    • Why?
      • When the site was in WordPress.com anyone with WordPress account could comment . Now this is hosted as a static site, I found Facebook comments are the easiest to setup as a commenting platform.
  • Theme Editor
    • Why?
      • I found its easier to edit the header/footer using this plugin for me to make some changes in the theme, and to add the google analytics code.
  • Amazon S3
    • Why?
      • This is where all my static files are hosted. With durability and availability that I can never achieve otherwise, this is a no-brainer.
  • Amazon Cloudfront
    • Why?
      • For SSL certificate support, and lesser page load times.
  • Amazon Route53
    • Why?
      • Currently I use it as my DNS server. In future when my current domain expires, I want to migrate the domain over also.
  • Amazon Glacier
    • Why?
      • Since now my active site is in my local machine, there are chances for it to get corrupted. I do not want to pay big amount to store it in S3. Right now, I backup my local VM, and upload to S3, and transition the storage class to glacier for really cheap storage.

Although this setup has many advantages, there is one problem that I am sure that will affect me.

  • WP2Static regenerates all the pages everytime I want to publish something. That means, as the site gets bigger, it will take more time to generate pages, and when I upload to S3, it needs to submit a lot of PUT requests, which would cost me money. I will also need to invalidate my cloudfront files, which could also cost me money. However, as of now I am not going to post a lot, and I don’t expect the site to get so big, I believe I can work with this for now.

So, is this site serverless ? Yes. The live site does not run on a server that I have to manage. It scales based on the load. It is cheap.

But is it the real serverless ? No.

Do I have plans to make it real serverless ? Who knows.. If I picks up coding in a later stage, I might. But not in near time.