Live data from Hacker News

Ask HN: Cheap back end for static website

news.ycombinator.com

1–10 of 30 posts

Ask HN: Cheap back end for static website

#1
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?

Re: Ask HN: Cheap back end for static website

#4
Without knowing what your tech stack is or what your familiar in, I'd consider Vercel and their serverless functions. They support Node.js, Go, Python and Ruby [1] and also have a very generous free tier in my opinion [2].

[1] https://vercel.com/docs/serverless-functions/supported-langu...

[2] https://vercel.com/docs/platform/limits

Re: Ask HN: Cheap back end for static website

#6
post #2

If your site has less < 5,000 users a month, I can't imagine exceeding Lambda's free tier limit. You definitely want to go serverless if budget's a constraint.

I'm not going to make a new AWS account to take advantage of the free tier

AWS Lambda is (currently) part of the "Always free" tier, with up to 1 million(!) requests per month. (See: https://aws.amazon.com/free/?all-free-tier.sort-by=item.addi...)

Re: Ask HN: Cheap back end for static website

#7
post #6

Earlier quoted context omitted.

I'm not going to make a new AWS account to take advantage of the free tier

AWS Lambda is (currently) part of the "Always free" tier, with up to 1 million(!) requests per month. (See: https://aws.amazon.com/free/?all-free-tier.sort-by=item.addi... )

wow thanks!

the 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

Re: Ask HN: Cheap back end for static website

#9

Without knowing what your tech stack is or what your familiar in, I'd consider Vercel and their serverless functions. They support Node.js, Go, Python and Ruby [1] and also have a very generous free tier in my opinion [2]. [1] https://vercel.com/docs/serverless-functions/supported-langu... [2] https://vercel.com/docs/platform/limits

that was surprisingly easy for the static site deployment with the Git integration, CDN, SSL, HTTPS out the box

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?

Re: Ask HN: Cheap back end for static website

#10
Literally any shared hosting service, of which there are bazillions. I pay $10 a month on A Small Orange to host a crappy Lektor blog that I publish by Git. What you're describing really needs very little infrastructure.
Post reply on HN