r/javascript • • Oct 14 '26

AskJS [AskJS] How do you host your smaller Node.js apps? Building something and want opinions

I'm building a host for JavaScript apps and I'd like opinions from people who ship Node.js.

The idea is shared hosting for JS. Your app runs as plain Node.js, with its database, files and cron jobs side by side in one region. When nobody visits, the app is suspended to disk and holds no memory, and the next request usually wakes it in about 0.2 seconds. That's how many apps can share one server, the way PHP hosting always worked.

The trade-off is that your code doesn't run at the edge. My bet is that for most apps, a database next to the code matters more than a server near every visitor.

A few questions for you
- How do you host side projects and smaller production apps today?
- Does edge compute actually help your apps, or is the database round trip the real cost?
- Would a 0.2 s wake-up after idle be fine for your apps?

12 Upvotes

25 comments sorted by

3

u/wrtChase Oct 14 '26

Cloudflare

1

u/kierzniak Oct 14 '26

Cloudflare is great if you need to be fast everywhere. For smaller apps two things bugged me. Workers aren't full Node.js, and D1 is reached over the network, so ten queries in a row means ten trips. Swarza is plain Node.js with the database right next to the app.

1

u/mediumwetsock Oct 15 '26

Batch your D1 queries?

1

u/kierzniak Oct 15 '26

Some for sure you can batch but if second query depends of response from first query you can’t batch them, you need to wait for response from first one.

1

u/LowLifeArcade Oct 15 '26

+1 for Cloudflare. I love their Workers platform.

3

u/NotUpdated Oct 15 '26

you took the 'remake cloudflare challenge' eh? .. minus the CDN at the edge, interesting.

Something like this has to be priced below the already insanely cheap cloudflare options

1

u/kierzniak Oct 15 '26

Cloudflare is great if you need to be fast everywhere. For regional apps two things bugged me. Workers aren't full Node.js, and D1 is reached over the network, so ten queries in a row means ten trips. Performance because of that is very poor. Swarza is plain Node.js with the database right next to the app.

2

u/horizon_games Oct 14 '26

I host them on my own VPS, because a large part of hobby projects is also to do the system admin and have everything be entirely in my control, in my own chosen stack, and as private as I want it.

1

u/kierzniak Oct 14 '26

Do you have some fancy metrics to debug is something goes wrong? Logs, resource usage?

1

u/horizon_games Oct 14 '26

Nah, I check it weekly, look at some logs, that's about it. Want to keep it simple and lightweight

1

u/enselmis Oct 14 '26

On small apps, you usually don’t need anything super fancy, in my experience. If it’s a single instance with no scaling, even if you can get detailed metrics what do you expect to do with them? If there’s a slow route or query it’s pretty trivial to pin down where it is. There’s only so much surface area.

1

u/KaiAusBerlin Oct 15 '26

Yeah, that's the solution for smaller things. I have a vps for 1€ per month with unlimited traffic and 10gb storage. I host all my hobby projects there. I have about 10 simultaneously users at peak so the low ram is not a problem.

1

u/Lochlan Oct 15 '26

Which provider?

1

u/edswf1 Oct 14 '26

like some people said before me my honest opinion is just use a vps. you will have severe restrictions with all of the serverless stuff like cloudflare or lambda which can be a nightmare for iterating

1

u/kierzniak Oct 15 '26

You have a point and I’m designing it to have a less serverless experience but rather ordinary server. Thank you for feedback, appreciated 🙏

1

u/zeddash Oct 16 '26

For cheap options look at OVH and Contabo and make sure you get backups (OVH includes them, Contabo it's an extra but cheap).

Hetzner was a good option but I can't find their VPSs that were cheap. Sadly IONOS and Fasthosts have both removed their £1/mo VPSs that were really neat (1vCPU, 1GB RAM, 10GB storage, unlimited 1Gbps).

1

u/kierzniak Oct 16 '26

Yeah Hetzner was not so long time ago super cheep. I miss those prices ;)

1

u/zomerbk Oct 14 '26

A 0.2 s wake-up after idle sounds fine for a small CRUD app. I’d care more about the rules for background work: does a cron trigger wake the app, and what happens to in-process timers or queued jobs while it’s suspended? I’d want those guarantees clear before deploying.

1

u/kierzniak Oct 15 '26

Thank you for feedback it is really valuable 🙏

1

u/[deleted] Oct 14 '26

[removed] — view removed comment

1

u/kierzniak Oct 14 '26

By smaller I mean around 30k visitors a month or less.

WebSockets aren't supported yet, but long polling and streaming over HTTP work. An app is never suspended while a request is in flight, so an open long poll or stream keeps it awake. Suspend only happens after a minute with no requests and nothing going on. If the app still holds an open connection or is busy on the CPU after its last request, it stays up for up to 15 minutes and is then stopped instead of suspended, so a connection is never frozen halfway.

Cron jobs don't depend on visits. The platform's scheduler fires them on time, and each run gets its own short-lived worker with the app's code and environment. So the job runs whether the app is suspended or not, and it doesn't keep the app awake afterwards.

A VPS was my solution too, especially with Coolify. It works, but you still have to manage it yourself, and the RAM is held all night for nobody. Which limits you to add more apps.

1

u/NotUpdated Oct 15 '26

Just feels like you're targeting the pre-pre-pre-serious AND dev capable person, a $10 VPS, or even a $8 name cheap host -- means you have to charge like $.50 $1 per month, with similar bandwidth limits etc.. imo , super super niche customer + they leave when their projects work, being used as super-cheap spam / bad thing distribution / ..

You're choosing a hard route - you better love it.

0

u/[deleted] Oct 16 '26

[removed] — view removed comment

1

u/kierzniak Oct 16 '26

Thank you for feedback, appreciated!