3 ms·
IMO the clearest advantage is that you can have multiple parallel instances of the same application but different services with no crosstalk. Basically the same
by pxeger1 5y ago
IMO the clearest advantage is that you can have multiple parallel instances of the same application but different services with no crosstalk. Basically the same as the disadvantages of using global variables to store state.
- donjoe 5y ago... and lots of developers forget that singletons are global state. Especially with node where you do not have a dedicated sandbox per user request, programming needs to be request-agnostic. This is especially painful with mixing server-side and non-server-side code where you do have a dedicated 'sandbox' on the client side (aka browser).