R
Railway2y ago
Xyo

NodeJS Scaling

So, I’ve seen people mentioning that you can have multiple instances of a deployment under the same project. While not exactly straight forward, it’s better then having multiple projects. Now, how exactly do we do that? I can’t find anything related to that on the dashboard. Is it actually referring to using different environments as instances?
7 Replies
Xyo
Xyo2y ago
And how would load balancing be handled there when it comes to custom domains? Do we just handle it externally? Do we proxy to the railway project domain?
root
root2y ago
I think that what is meant is: For each project, you can have multiple environments. Each environment can have its own services and plugins, which (I think) can be different between environments. Each service only has one active deployment (hooked up to the domain), but the previous deployment is kept alive until the current is deployed/healthcheck succeeds. Some people in the past have had issues with "ghost deployments", where previous deployments remain active for longer than they should, but I don't think that that's happened recently.
angelo
angelo2y ago
@aleks - I think what this user is referring to is throwing a reverse proxy for Horizontal Scaling. @Xyo - yes, you would make a new service and make as many as you need, then route with NGINX or Cloudflare to route requests to that group of running services. We should make a guide for this.
Xyo
Xyo2y ago
Hmm, are builds concurrent? 🤔 Cause if I were to have 10 separate services and they had to build in a sequence, that may cause issues with data
angelo
angelo2y ago
When you throw a commit to a repo that needs to be rebuilt, all services get a new build.
Xyo
Xyo2y ago
Yeah what I meant is, do they all build concurrently? I'm coming from Vercel where concurrent build is a luxury haha
angelo
angelo2y ago
Yes They do