Hello Hugo
As previously mentioned in Hello World this website is built by a static site generator named Hugo. Not to detract from the excellent introduction on the Hugo homepage, Hugo will generate all pages of this website only when the content is updated, and store the result in standard HTML files.
Traditional Content Management Systems (CMS) run on a server-side language such as PHP, ASP.NET, or Java, and along with a database, will render a webpage each and every time it is requested by a website visitor. Even if the content or design of a page might never change the page will still be generated for each visit.
The complexity and dynamic functionality offered by a powerful CMS is necessary for a popular and intricate website. Any interactive feature such as user registration or e-commerce wouldn’t be possible on a static site. But this website has none of those things, and it would be expensive to run in a full CMS. Here’s a brief breakdown of the design and costs of hosting each solution.
Hosting a CMS on AWS
A CMS needs server-side processing to render pages, and a database to store content. Even a simple deployment as pictured below will cost just over $100/month to run.
- 2x t2.small EC2 instances = $33
- 1x ELB = $18
- 1x t2.small Multi-AZ RDS = $51
For the sake of comparison this design offers some resiliency from failure of an Availability Zone (AZ). Operating out of one zone brings the monthly cost down closer to $60/month, but the site will go offline in the event of an AZ failure.
These costs will grow as website popularity increases as the size of the EC2 instances and RDS databases would need increasing.
Hosting a static website
Hosting a static website requires only the most basic webserver with no special server-side language support. An Amazon S3 bucket can be configured to serve files publicly over HTTP. As Hugo renders static HTML files these can be placed into a bucket and served directly by S3-Website.
The cost of this? Closer to $1/month.
In addition to the fractional monthly cost
- AWS promises 99.99% uptime for S3 (equivalent to 52 minutes downtime in a year)
- There are no EC2 instances to maintain and monitor
- No backups to be concerned about
There are some downsides and considerations to keep in mind. More on S3-Website to come.