title: Storing Socket.io Object in a persisted DB or redis
body: <p>Building a customer service Chat application. Hence need to keep track of customers logged in sockets and attach them to Admin/agent room. </p>
  
  <p>As of now, I have achieved this by using simple <code>JSON</code> object. But to scale app, I need to find out a place where I can store them. Since Socket object is in form of Circular JSON, I am not able to store it in Redis. I tried using 'Douglas Crockford's Cycle.js, but looks like it is changing the nature of the object in decycle / retrocycle. </p>
  
  <p>Please help me finding a solution to keep track of customer &amp; Agents sockets and connect them as a request comes in from agent's front end. </p>
  
  <p>Current Solution:</p>
  
  <pre><code>// Admin Socket -
  
  admins[socket.username] = socket;
  
  // Customer socket
  
  users[socket.roomID] = socket;
  </code></pre>
  
  <p>Need to run this solution on multi-core Linux machine using 16 cores for 16 Socket servers/node.js cluster proxied by Nginx. So need to quickly find a solution for robust architecture.</p>
  
  <p>One more info:</p>
  
  <ol>
  <li>I am using Redis for Sub/pub for scaling out.</li>
  <li>And using Redis to store messages for short history. </li>
  </ol>
  
  <p>P.S. (MongoDB is no more permitted in my org. Mongo Based solution will not work for me.) </p>