0

I am new to node.js and strongloop.

After having tried out strongloop on windows , i could get one Application[REST Loopback service] associated to one running node instance[PID associated]. Starting another application on a different port starts another node process with a diffrent PID.

From production perspective would it make sense to have multiple node instances running for each REST API or should all the REST APIs be running on a single node instance?

I am not aware of the second approach, please suggest if this is achievable and makes sense?

Many Thanks, Wajid

wajid mehraj
  • 263
  • 3
  • 14

1 Answers1

0

If you are wanting to keep things simple, one monolithic instance makes sense. Otherwise, you can split out your REST APIs (like a microservices architecture for example), but increase the complexity of managing your infrastructure. In the end, it really depends on your use case.

superkhau
  • 2,781
  • 18
  • 9
  • Are you aware of how a "single monolithic instance" can be implemented and how that can be achieved in strong-loop. – wajid mehraj Dec 04 '14 at 07:53
  • What I meant was you can start with a single LoopBack instance and go from there. See the getting started guide at: http://docs.strongloop.com/display/LB/Getting+started+with+LoopBack – superkhau Dec 04 '14 at 08:04
  • Thanks for sharing the link @superkhau and have managed to get a single loop-back instance running but would like to know how can i have multiple loopback instances[Rest APIs] running within a single node.exe instance... – wajid mehraj Dec 04 '14 at 08:10
  • I don't think its possible at the moment. Typically, one would start multiple applications with their own configurations. For example, serve app1 from localhost:3000 and app2 from localhost:3001, etc. You can however cluster the single instance via `slc run --cluster 4` to have 4 worker processes for example. See http://docs.strongloop.com/display/SLC/Application+clustering – superkhau Dec 04 '14 at 08:15
  • What do you mean by "for each REST API", do you have multiple models being served from one LoopBack instance? – superkhau Dec 04 '14 at 09:16
  • I have one REST API Instance mapped to a single model and served as one Loop-Back Instance... And this starts as one process..And another REST API starts with another process... – wajid mehraj Dec 04 '14 at 09:23
  • As listed in your Answer if i go for one monolithic instance, i would have a single REST API URI with a lot of contexts.. is that what u mean.. – wajid mehraj Dec 04 '14 at 09:26
  • What I meant was you can serve up multiple models (meaning multiple REST endpoints for each model) using one LoopBack instance. Not sure what you mean by "a single REST API URI with a lot of contexts". – superkhau Dec 04 '14 at 19:31