Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8956883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:51:56+00:00 2026-06-15T14:51:56+00:00

I am trying to solve a problem that has been blocking me for a

  • 0

I am trying to solve a problem that has been blocking me for a month

I am bulding the backend of an application using Node.js & Redis and due to our structure we have to transfer data from one redis table to another (What I mean by table is the one’s that we use “select” i.e. “select 2”)

We receive a lot of request and push a lot of response in a sec, and no matter how much I tried I could not stop data getting mixed. Assume we have a “teacherID” that has to be stored inside Redis table #2. And a “studentID” that has to be stored in Redis table #4. How matter what I tried (I’ve checked my code multiple times) I could not stop teacherID getting into studentID. The last trick I’ve tried was actually placing callback at each select.;

redisClient.select(4, function(err) {
  if(err)
    console.log("You could not select the table. Function will be aborted");
  else {
    // Proceed with the logic
  }
});

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? (Even though I cannot share the code to NDA I can make sure that logic has been coded correctly)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:51:56+00:00Added an answer on June 15, 2026 at 2:51 pm

    I’m not sure about your statement about having to “transfer data from one redis table to another”. Reading through your example it seems like you could simply have two redis clients that write to different databases (what you called “tables”).

    It would look similar to this:

    var redis = require("redis");
    var client1 = redis.createClient(6379, '127.0.0.1');
    var client2 = redis.createClient(6379, '127.0.0.1');
    
    client1.select(2, function(err){
        console.log('client 1 is using database 2');
    });
    
    client2.select(4, function(err){
        console.log('client 2 is using database 4');
    });
    

    Then, wherever your read/write logic is, you just use the appropriate client:

    client1.set("someKey", "teacherID", function(err){
        // ...
    });
    
    client2.set("someKey", "studentID", function(err){
        // ...
    });
    

    You can obviously encapsulate the above into functions with callbacks, nest the operations, use some async library, etc. to make it do whatever you need it to do. If you need to transfer values from database 2 to database 4 you could do a simple client1.get() and client2.set().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to solve the following problem in Redis. I have a list that
I have a problem that I have been trying to solve since days! I
I've got a rather tricky problem that I've been trying to solve for the
I'm trying to solve a dilemna that has been nagging me for the last
I'm having a problem that I've been trying to solve for a while, but
I'm trying to solve a problem that anonymous functions make much, much easier, and
I am trying to solve this exponentiation problem . Here is the code that
This the problem in my book that I am trying to solve..I need to
I'm trying to solve this problem in a pure-functional way, without using set! .
I am trying to use jsonp to solve a page performance problem I've been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.