Fun with serverless

on 2017-11-24
by Tony Petrangelo

I bought this domain some time ago because it's my name and I thought I should own my name in web domain form. I bought this domain and I imagine like most domains that are purchased, I did nothing with it for a while. Obviously I did something with it eventually, because you're here reading this.

The thing I finally decided to do with this domain was to build a serverless website. 

My initial attempt was to try and mimic the functionality of a traditional dynamic website using serverless architecture. So I setup an AWS API Gateway and used a Lambda function to respond to requests and render the html response. This worked. But the site was slow

At some point I realized I was going about this all wrong. I was excited about trying to recreate a traditional CMS in a serverless environment without bothering to step back and ask why I would want to recreate a traditional CMS in a serverless environment.

This caused me to rediscover a thing I thought I had forever left behind, the static website. 

The advantages of static websites over dynamic website are multitude, they are faster, which in a mobile dominated world is more important than ever. They are more secure, there is no server or CMS software that needs updates and is vulnerable to attacks. They cost less money to host.

One of the disadvantages of a static website, and the reason most people went to dynamic websites in the first place, is it's a static website. Every single page on the website has an actual file associated with it, so if you want to edit the header or the footer or any other recurring html elements you have to make those changes to every single static file that makes up the website. Another disadvantage is that there is no back-end server to process stuff like user logins, form submissions, purchasing, etc.

This is where the serverless CMS comes in, for managing static website design changes, page creation and editing, and back-end processing. Using the method I inititally tried to use for the website itself I deployed an admin subdomain. From there I can make changes to the website templates or content and the process of updating the site itself happens behind the scenes.

If you have any questions feel free to tweet at me @TonyAngelo.