i'm developing a node.js backend for a real-time chat app on heroku. As i'm looking at dynos and ways to scale the node.js backend, i can see the advantage that dynos could have on http servers because each dyno can be independent from other dynos (which is ok for most cases).
My question is: how can you scale and handle load balancing of real-time socket.io apps? From what i'm reading dynos are containers that are 'sandboxed': each dyno runs its own process, independent from the other dynos.. so what is the best way to handle the problem?
I was thinking of a solution but it isn't elegant or pretty at all:
i could have multiple background jobs that contain crons that can check for new messages for the users connected on that instance.. but i think there must be a better solution.