Static web hosting solutions
This is a list of web hosting solutions. I have researched and tried each one of them. Every item on the list has a description, cost, and my own opinion about them.
Summary
- Amplify: best option for small/medium websites.
- Cloudfront+S3: only worth it for cutting costs of Huge websites.
Cloudfront + S3 (AWS)
This solution involves using an S3 bucket to storage the website files and Cloudfront to serve the files to the user through a CDN.
Cost
The cost is divided into: bucket storage, Cloudfront requests and Cloudfront data transfer. Cloudfront data transfer is the most important because it scales proportional to the users and website content size, also its the most expensive. Cloudfront requests are the same but are cheaper. Finally, the storage costs are negligible.
At the time I write this the costs are:
- Cloudfront transfer: $0.085/GB
- Cloudfront requests(HTTPS): $0.01 / 10 000 requests
- S3: $0.023/GB/month
Small Websites
It’s free.
If you go with Cloudfront PAYG, then you pay some cents. Cloudfront has a generous free tier of 1TB transfer and 10 million requests, so you only pay cents for the bucket storage.
Cloudfront also has plans with a limited amount of transfer and requests. The free plan is… free, like completely free, it even includes free storage.
Big Website
As I said before, the transfer cost are extremely expensive. This follows the Big Cloud Providers policy of stabbing you in the back if you let data escape their data centers.
Opinion
I think this method makes sense if you want to host a website that will scale and you don’t want to worry about it. For a small website is overkill and doesn’t have a lot of pretty QoL features built in(eg. Amplify), so I would not recommend it. I think the only use case for this service is a website with millions of visits per month.
Amplify
Amplify is a simplified web hosting solution that integrates automatic deployment and other features to make the deployment of a website extremely easy. It abstracts a lot of AWS products so the “developer” doesn’t have to deal with them. I have only used the frontend hosting side, but it also acts as BaaS (Backend as a Service) so you can connect your webapp with a backend and database using abstractions.
Cost
This service has a LOT of features and each one has its own price, I will only write about the ones concerning “frontend hosting”. The cost is divided into storage costs and data trasnsfer; the automatic build feature is very common so I will add it too.
At the time I write this the costs are:
- Data transfer: $0.15GB
- Storage: $0.023/GB/month (normal S3 cost)
- Build time: $0.01/minute with standard instance (the cheapest and default option)
Small Website
There is no always-free-tier so it won’t be completely cheap. For a small website the price for data transfer won’t be too expensive and you get a simple and comfortable platform to host your website. The build cost has a minimum of 1 cent, so if you will be pushing a lot of changes (like I do with this website) the bill will increase a few dollars.
Big Website
The biggest concern is the data transfer, it is 1.76x the amount that Cloudfront bills.
Let’s imagine a real situation to see how the costs behave. Let’s say, I have a React WebApp with a starting bundle size of 25kb (I think I’m being generous), also there are 1000 regular users that enter the app daily.
With these number we have a transfer = 1000 users * 31 days * 25 000 bytes = 775MB So the cost is $0.11, roughly a dime.
Opinion
It can work for small websites because you pay less than a dollar and you get a nice service to host your website with automatic deployment and a lot of things out of the box.
For something bigger, there really is a need to assess the expenses and the real value of the features. Having automatic deployment out of the box is nice… paying 1.76x more just for that? I’m not so sure. There is a point were it becomes too expensive to justify, but this situation probably appears with very big websites, medium ones probably can afford it.
This is sort of a trap because if you host something small with few users that happens to go viral then you are fucked, you will pay basically double the amount you would if the site was hosted on Cloudfront.
For me, the data transfer cost is so cheap and the risk of scale so low, that the extra features are worth the cost. All the hassle of setting cloudfront is not worth some pennies. I totally recommend this solution, in fact, its the one this website uses right now.