7. Redis and websocket ?
• handle stateless auth -> pass a token each
request pass from front
• redis is a central point of communication:
super fast and performant
• PUB SUB ! -> push to websocket
8. Redis and websocket
• each token -> a user id
• after authenticate, the eventmachine tcp
session register to redis pub pipe with key
user id
• all message to user from rails -> pub redis
key -> eventmachine redis -> websocket /
browser in real time of course
9. Rails -> redis
• Rails app write data in redis key before
pushing
• when user reconnect -> eventmachine
make a get on key and push back to
browser
• some part of app are render only with
webscoket data -> better consistency