I’ve been building and hosting websites for clients for years now. I do this with a CMS and host it in different places including AWS’s EC2. I’ve been reading for years now about using AWS Lambda and have seen some hint at it can be used to host a website. The motive for doing so, is that potentially the cost would be significantly lower compared to running a EC2 instance 24/7.
But is anyone really using AWS Lambda for website hosting? If so, what CMS or framework are you using? What about the latency issue where the AWS Lambda needs to startup before it can serve a web page? I’m not talking about using S3 to host a static website, I’m talking about lifting and moving CMS type of websites to AWS Lambda.
Thanks for reading my preample here. My factual question: Is AWS Lambda ready for prime time to host a website as described, or is this wishingful thinking for the future?
Since nobody qualified (or otherwise) has responded thus far, you get an amateur response. I don’t host websites on AWS at all, but from what I can tell Lambda is not a hosting service. It seems to be made for backends, an alternative to Node.js if you are doing a webapp or something that requires a lot of computations. If you want to use Lambda to serve the frontend HTTP GET request (an anti-pattern), if I’m reading correctly, you would have to pay Amazon API Gateway (or other backend service) to route the HTTP request to the Lambda API.
From what I can tell (and again I am not very knowledgeable here), even if you use AWS Lambda functions to dynamically build the website and serve the HTTP response, and Amazon API Gateway to set up a public HTTP endpoint, you still need a hosting service to actually host the resources - images, audio, video, etc.
I mean, you could copy-paste all the website resources, text-encoded, into Lambda functions. But that would be a pain to manage, and an anti-pattern; it would probably nuke Lambda’s cold start response time because the function artifact size would be huge.
Well, maybe. One can imagine a site with almost no actual local content, where everything is dynamic. Fonts, JS libraries, etc. could be from external sources (though the Germans might fine you).
The bare minimum Lambda instance is 128 MB, which sounds like quite a lot to me. Again, if it’s mostly simple text and the like, that’s really a decent amount of storage.
A CMS is going to require a database of some kind. Amazon does have a free tier for their DynamoDB as well with 25 GB and 200M requests/mo. In fact they have quite a few “always free” services (i.e., not a limited 1-year trial):