Is it possible to change strategy of assigning worker to request on nodejs cluster? I mean on first client access select worker and later keep client on this worker by session id.
I'm using memory cache as a storage for large structure of objects. Every client (session) has own data in this storage. All stored objects are configured and referenced (with cycles). This was solution to complicated serialization to redis/memcached.
Now on cluster, every request could be processed by different worker, so data for same session will be created, in worst case, under every worker.
Is it about some setting of cluster, or is it possible to write method? which helps select worker for client session. When worker dies, it will select new one and session data will be recreated from permanent storage (mysql).
Try amino cluster, it has support for sticky sessions through amino gateway. https://npmjs.org/package/amino