I was building a nodejs chat app using socket.io. And i need to store a map with user->socketID key->value pairs(my messages will have a sender and receiver and so i can send to the intended receiver if i have the socket they are in).
I could use a global variable to do it. But then that makes it stateful. So i was wondering since Redis is an in-memory cache(It stores data in ram i think??) service. Does storing data in it also makes my api stateful.Because we are still storing some info about users.
Yes, Storting any kind of user information on the server violates the rules of Stateless REST API, In stateless REST API, Client is responsible to send you all data that you require to process on server. Please go through these links to have a better understading.