Reputation:
I have been working with a couple Node.js frameworks to create applications of which I typically use Heroku to deploy. Recently I came across this disclaimer on Derby's documentation page that states:
Note that while Derby supports multiple servers, it currently requires that clients repeatedly connect to the same server. Heroku does not support sticky sessions or WebSockets, so it isn’t possible to use more than one dyno. You’ll have to use a different hosting option to scale your app.
This is obviously concerning for scalability. Because of the statement above, I understand it is not a Node limitation, but a Heroku limitation.
First, is this accurate? That is - I cannot scale Node apps on Heroku?
If that is the truth, where should I turn? AWS?
Thanks.
Upvotes: 1
Views: 549
Reputation: 34327
Derby is not a typical Node.js app. Derby (and Meteor) are essentially complete frameworks built on top of Node. Websockets is not yet supported on Heroku: https://devcenter.heroku.com/articles/using-socket-io-with-node-js-on-heroku
However, the typical alternative to sticky sessions for regular Node apps is to use a datastore like Redis (or Postgres or Mongo) to store session data. This is a far more robust approach than sticky sessions, as it's resilient to the failure of any particular device.
Take a look at http://12factor.net/ for more info on horizontal scaling.
Upvotes: 1