title: Redis: Wrong data in wrong tables
body: <p>I am trying to solve a problem that has been blocking me for a month</p>
  
  <p>I am bulding the backend of an application using <b>Node.js & Redis</b> and due to our structure we have to <b>transfer data from one redis table to another</b> <i>(What I mean by <b>table</b> is the one's that we use "select" i.e. "select 2")</i></p>
  
  <p>We receive a lot of request and push a lot of response in a sec, and no matter how much I tried <b>I could not stop data getting mixed</b>. Assume we have a <b>"teacherID"</b> that has to be stored inside <b>Redis table #2</b>. And a <b>"studentID"</b> that has to be stored in <b>Redis table #4</b>. How matter what I tried (I've checked my code multiple times) I could not stop <b>teacherID getting into studentID</b>. The last trick I've tried was actually <b>placing callback at each select.</b>;</p>
  
  <pre><code>redisClient.select(4, function(err) {
    if(err)
      console.log("You could not select the table. Function will be aborted");
    else {
      // Proceed with the logic
    }
  });
  </code></pre>
  
  <p>What could be the reason that I cannot simply stop this mess ? One detail that drivers me crazy is that it works really well on local and also online however whenever multiple request reach to server it gets mixed. Any suggestions to prevent this error? <i>(Even though I cannot share the code to NDA I can make sure that logic has been coded correctly)</i></p>