4

I am very new to redis and this has always made me curious.

I am using a single redis client connection in nodejs (npm's redis package) which is included in each of my files.

Say for eg : File a.js is used for reading from mysql and inserting the data into redis hash ,file b.js reads from redis hash and outputs the result.

Now in a production environment i have a large numbers of request comming to b.js files which serves the content and in between i have a few request being made to a.js files to update the contents on the fly.

I want to know if a request to a.js slows down the already running redis connection in b.js.

Rohit Nayal
  • 272
  • 4
  • 15
  • Could you please select an answer and mark it as accepted? This will help other SO users that might have the same question as you. – lisa May 07 '16 at 13:07

3 Answers3

4

Redis is single threaded, so if it's busy writing data, your reads will be delayed.

You'll find more information in this SO answer: Redis is single-threaded, then how does it do concurrent I/O?

Community
  • 1
  • 1
lisa
  • 584
  • 2
  • 16
0

Redis is single threaded then there is no concurrent read/write. If there are 2 client connection sending command to the redis they will be queued.

Then yes if a.js send a lot of commands to the Redis, b.js commands will be inserted between a.js commands

khanou
  • 1,344
  • 11
  • 15
0

No, the connection will not be slow down. What will slow down is the response time from redis. But I doubt you will notice as we are talking about a few micro-seconds per request.