0

Imagine a large node.js app with a multi-purpose api for mobile and frontend with a serving static files, with a websocket server, lot of cron jobs and workers. Basically I can horizontally or vertically scale a whole app, use a load balancer and so on.

But from a perspective of a business logic, whole app is one big "bundle" where some parts are used more than others, also some parts have bigger impact on a performance of app than another. For example, mobile API may be used 100x more than some cron which starts 1 time per hour to make some cleanup. So is it necessary to scale whole app?

Isn't it better to scale app to separate modules and scale only needed? For example

  • mobile api
  • FE api
  • crons and workers
  • websocket
  • whatever...

If so, what is proper way to handle business logic? There is a parts of code I would need in every submodule of application, for example database models, migrations (seeders?), maybe I would need some general functionality, like some specific utils functions or enum definitions. So I can create git submodules for them, but there is risk it will be too much complex to handle 4-6 git repositories with a 2-4 git submodules and handle whole app in multiple environments (dev, stage, uat, prod). Are there some others caveats of this approach? Or is it unusable?

I dived into waters of internet and searched for some resources for example node.js best practice, scaling node.js, scaling node.js, good scaling practice but it not fully answered all my questions.

4
  • 1
    This is an interesting question, alas, not a good fit for Stack Overflow, I'm afraid. It is too broad and opinion based Commented Jul 23, 2019 at 19:49
  • Any suggestion to change platform? Commented Jul 24, 2019 at 6:20
  • Sorry, wrong comment Commented Jul 24, 2019 at 6:48
  • 1
    You may want to try softwareengineering.stackexchange.com Commented Jul 24, 2019 at 6:50

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.