I've got a question about scaling a SailJS app on Heroku.
The setup :
- SailJS
- Kue (Redis queueing system)
- Connected clients by means of socket io (sailsjs)
- 2 dyno's (each run a SailsJS instance)
- CronJob kind of process
I want to autonomously run a continuous 'cron' process, which triggers a push message, which must be sent to a connected socketio client. I am aware the socket connections reside in Redis, when this is configured correctly.
I use kue for nodejs, and trigger a worker to process the task. The worker is situated in the SailsJS instance, to be able to send a connected socket client a push message.
But I wonder, not every SailsJS instance (dyno) has the same connected sockets right? In other words, does every SailsJS instance has the same connected socket clients available, or is it possible dyno1 has a set of connected clients, and the other dyno the other set of clients??
e.g:
Heroku Cloud => Cron => Kue (Redis)
=> Dyno 1 (SailsJS instance) => client 1
=> client 2
=> Dyno 2 (SailsJS instance) => client 3
=> client 4
How does one solve this... :-D?