Ron
Ron

Reputation: 79

Sharing same session across multiple instances of nodejs app

I have an app written in nodejs and express, we have used passport js for auth. What I'm looking for is to share the session across multiple nodejs instances. So there is one app which will run on different ports i.e. instances.

Is there any better way with Redis? If any of you have implemented something similar then do let me know. Thanks

Upvotes: 0

Views: 1323

Answers (1)

Kfir Bloch
Kfir Bloch

Reputation: 68

Any fast storage, Redis is the best, but also memcache, even mysql if you want to pay with some I/O. Another non-recommended way to resolve it is to configure the load-balancer/NGINX to have sticky session, so same user will always reach the same server. It will be the cheapest way to resolve it, but i don't recommend on statefull servers

Upvotes: 1

Related Questions