AWS Amplify vs Netlify
For the past few years I’ve been feeling like WordPress is overkill. Do I really need to call a database to serve up mostly static webpages? There had to be a better way, and there is, static site generators or JAMstack. If you never heard of static site generators or JAMstack check out Modern Web Development on the JAMstack.
Of Generators and Hosts
There are several static site generator options available. I selected Gatsby since its based on React which I used previously. Since the final pages are static you no longer need a traditional hosting environment. After building the site you could just use an S3 bucket configured as a static site. However there are several options available that connect to Github then automatically build and publishing your site. Of the various options I tried the two standouts are AWS Amplify and Netlify.
If you already use AWS its super easy to setup Amplify. Once you connect to your Github repo Amplify automatically detects new commits, builds the site and publishes it. Pretty sweet! Then you can swing over to Rout53 and connect your Amplify site with a custom domain and HTTPS. Since I’m familiar with AWS this is fairly simple. However if you are new to AWS connecting your domain and adding HTTPS is a bit tedious.
Setting up a Netlify site is very similar to Amplify. Connect Netlify to your Github repo and they then it automatically detects commits, build the site and publishes is. The main thing I love about Netlify is you can get started with a site without entering billing info. Just login with your Github account and you can have a live site in a few minutes. If you have a domain, follow the super simple instructions for repointing your DNS. Then they automatically add HTTPS.
As much as I love the serverless nature of static sites there are a few adjustments that take getting used to. One is creating a simple form or accessing a database. In the world of traditional servers and PHP I can cut and paste a form, ajax call and PHP script together in a few minutes. However with a static site you need to connect to a Lambda function.
This isn’t rocket science but it initially feels way more complicated that a traditional PHP script. Netlify claims to 100% automate a contact form by simply adding a data attribute to a form. They also offer a way to interact with AWS Lambda without even having an AWS account. I’m hoping to test these features out in the near future.