r/node • • 23h ago

Where do you host a small Express API + always-on worker + Postgres cheaply?

Small app: Express API, Postgres, and a worker that polls an outbox table every 5s for background jobs. Low traffic, but the worker can't sleep, so free tiers like Render free and Neon free don't work.

Options I'm weighing:

- AWS free plan for 6 months (then ~$25/month)

- Hetzner CX23 (~€6/month) with everything on one box

- Railway Hobby (~$5-8/month)

What would you pick, and what am I missing? Please suggest.

12 Upvotes

36 comments sorted by

2

u/FalconGood4891 23h ago

Heroku 5$/month

1

u/Jack_Sparrow2018 23h ago

Thanks, that’s helpful. Do you run your crons as an Eco worker dyno 24/7? Curious if the web + worker fit inside the 1000 Eco hours for you, or if you had to move to Basic. And which Postgres plan are you on?

1

u/FalconGood4891 23h ago

Yes I run everything inside eco dyno, and not even full 1000hrs being used. Because it's 1app 24hrs*31days at max around 750hrs. Since for me it's a cms and backend crons, and some rest apis which isn't frontfacing ( being used by millions of users ) I have made a monolithic architecture and kept it in the eco dyno and it works great, never faced any downtime. Also try to setup the server location nearby to your access location for lil better speed.

→ More replies (6)

1

u/FalconGood4891 23h ago

I have used railway too, now moved to heroku for similar app ( backend cms + crons ), and the experience has been very value for money. Reason to go for heroku due to the availability of out of the box availability of helpful add ons, easy deployments, simple platform with all necessary settings upfront and very predictable pricing and usage.

2

u/Soft_Cat2594 23h ago

Maybe try a free instance on oracle to test. I think it would be suitable for your use-case if your service is not too compute intensive. You can run node/express and postgress on the same machine.

1

u/Jack_Sparrow2018 23h ago

Good shout, thanks. I’ll try it to practise the deploy setup. Have you had any issues with idle reclamation? My app is low traffic, so I’m thinking of sizing the VM small (1 OCPU / 4 GB) so memory stays above 20%.

2

u/Soft_Cat2594 22h ago

Never had a instance reclaimed, but I did add a credit card, so then its not really an issue. (Use a virtual card that way you can cancel it anytime easily)

4

u/Negative0 23h ago

Digital Ocean droplet runs me about $4 a month.

4

u/Sudden_Gap77 22h ago

You can try oracle free tier

3

u/vinnie1123 12h ago

this..

currently have 2 Always Free A1.Flex VMs.

although initially with free plan, I had trouble provisioning VMs due to DC I chose had no capacity. Had to upgrade to a paid plan, and suddenly was able get it. I’ve setup an alert if any charges comes up, so far none. 😅

3

u/Blitzsturm 19h ago edited 19h ago
  • AWS EC2 is an easy go-to since it's so scalable.

  • AWS LightSail is very turnkey, starts at $5/mo.

  • Heroku I think starts at $7/mo and is very turnkey.

  • Digital Ocean is very popular and has some cheap low-end boxes.

  • Google's Firebase has some unique solutions

  • Leapcell is a lesser known but reasonably priced service

I've used other services that are less established and have just "disappeared". So, I'd be a little cautious arround some providers if they are lesser known.

On any service that gives you CLI access (basically not Heroku) you can put a local Postgres on the same box if your need for horsepower is low.

Also, you may have to elaborate on your needs regarding the "no sleep" requirement. Many services allow endpoints to be called on-demand like AWS Lambda or Google Firebases cloud functions. These are the near-free options for low demand services. Also if you have something that needs to keep running you can use scheduled background workers on some services that kick off every 15 minutes (or whatever you set) to perform tasks you'd normally want running all the time. So it depends what exactly you need by no sleeping.

Also, worth a note, if your internet provider can give you a static IP and isn't blocking ports you can host on your local internet connection, though I'd use something like Cloudflare's DNS Proxy to hide your IP depending on what you're doing. Also localtunnel (Appears to use older Axios so use at your own risk) is a handy little package/service that lets you "host" even when you don't have a static IP or some ports are blocked. You can also do a hybrid option where you have a low powered box that talks to home computer(s) for more power. Hosting locally means you effectively have unlimited horsepower for free but dependability is lower.

4

u/Fine-Comparison-2949 23h ago

Cloudflare durable objects? 

2

u/RangerOne122 21h ago

That AWS free tier cliff after six months is a trap you want to avoid. Skip the migration headache later and just drop everything onto a single cheap European VPS since your traffic is already low anyway.

3

u/VehaMeursault 22h ago

Digital ocean.

1

u/unbanned_lol 20h ago

47thing DO.

1

u/fykup 16h ago

Check out r/tierhive. I host my 512MB VPS for less than $3/mo, and they charge hourly, so you can pause it if needed.

0

u/birbman77 23h ago

Railway

-5

u/javatextbook 22h ago

What an odd question. I’d like to know more about your design on why it requires an always on server. Why a serverless function wouldn’t suffice