HACKER Q&A
📣 vmception

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?


  👤 CallMeMarc Accepted Answer ✓
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


👤 trhoad
$5 Digital Ocean droplet with the one-click NodeJS install: https://marketplace.digitalocean.com/apps/nodejs

👤 tiew9Vii
I think on a budget it’s hard to beat Cloudflare workers.

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.


👤 aru
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.

👤 Adrig
I'm on Netlify, but Vercel or Render are also popular options for static websites and jamstack

👤 krapp
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.

👤 hilmanski
Take a look at this free serverless options for developer https://freestuff.dev/tags/serverless/

👤 satya71
An alternative to consider: Cloudflare Workers + Workers KV. Generous free tier

👤 mr_o47
Try vercel and it works great

👤 mars4rp
Try Glitch, I am hosting some websites there, with $10 a month you can host multiple small sites.

Or pay $5 for a Digital Ocean, but probably needs a little bit more configurations


👤 cnuss
hey Vmception! I've been working on a brand new framework that provides exactly what you need, and I'm looking for a few early adopters. hit me up! christian [at] scaffold.ly

👤 giantg2
I am planning on using AWS S3 with a Lambda for a static site.

👤 sergiotapia
render.com for $7 a month.

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.


👤 schwartzworld
Netlify will suit your use case, probably for free

👤 cpach
Amazon Web Services or Fly.io or VPS on Digital Ocean

👤 high_byte
Glitch can run nodejs+static web+hide keys