Ask HN: Cheap back end for static website
Hello, I have a static website that I want to do a couple asnychronous requests for data, used to render some data visualizations.
I could do it on the website's javascript itself, except for the API keys needed to access the third party. So instead I'll put the API keys on the server and get the data and serve the result to the website.
Heroku cost $25/month. I can think of an AWS lambda + database that would theoretically be cheaper, or theoretically more expensive. But what would you guys use?
29 comments
[ 2.7 ms ] story [ 67.6 ms ] threadthe next question is whether I should have just one lambda call that gets my external data and serves it to the clientside requester
or if I should have one lambda that does gets my external data on a timed job, caches the response in a database, and a separate lambda that reads the response
on AWS it seems the databases are the most expensive thing
guess I could also just cross that bridge when I get there, just feel like I could get spammed to a big bill even if I put in some session variables client side
this is just a static website trying to power a data visualization on semi-live data
[1] https://vercel.com/docs/serverless-functions/supported-langu...
[2] https://vercel.com/docs/platform/limits
serverless functions require the $20/month plan? hmmmm
but lambda will be free for me, although if I use a database it won't be
edit: the usage limits document you posted says there are serverless functions available for hobby/free tier, but the dashboard says the serverless is only available for pro plan. do they mean the serverless GUI is only available?
But reading the docs I’d just copy an example hello world function into my git repository, try to deploy it and check if it works without paying.
Regarding the lambda approach, I personally think lambda functions and especially with the api gateway get too complicated too fast in comparison with a solution like Vercel. I’d definitely recommend an infrastructure as code tool like Terraform if you choose this approach.
It seems as if this wasn't clear from the UI. Would you agree? It sounds like you've assumed that it's the entire Serverless Function feature that would not be available.
Or pay $5 for a Digital Ocean, but probably needs a little bit more configurations
Database or key/value storage, decent connection performance
Digitalocean is $5 but you need to handle all the management that comes with it.
with render you just point it to a github repo and you're done.
I’ve never been a fan of the serverless model, building on AWS Lambda etc, wiring up API gateways, slow cold starts, the hidden extra costs, EGRESS, gateway pricing etc.
Recently trying Cloudflare workers has been a pleasant experience. It’s still early, a few rough edges and limits to work within etc but I’m pretty convinced they are going to disrupt the serverless market. Fastly’s C@E is even more exciting being WASI but although Fastly advertise it as available you cannot go to their website give them your credit card number and use C@E. Likewise when C@E is generally available if the pricing is like the CDN it’ll be a non starter outside of business use.
Back to Cloudflare workers. Generous free tier, good non free tier pricing, static hosting, globally distributed workers by default, fast cold starts, WASM support, KV persistence, hook in to the cache easily, distributed objects for persistence if you can work around limitations. No need wiring up API gateways etc, write a traditional monolithic api with a router.
If you can design around utilising cloudflare it’d likely scale better than any cheap vps. I got a very long way for free with cloudflare then had to pay all of $5 to upgrade my plan as a worker needed 12ms cpu time instead of 10ms as was connecting to an Azure CosmosDb database and I think request signing eat in to my cpu budget.