r/node • u/Jack_Sparrow2018 • 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.
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
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
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
1
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.
-1
0
0
-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
2
u/FalconGood4891 23h ago
Heroku 5$/month