Redis master and read-only slave

Hello,

In Windows I have a Redis master node running. I write data from a sensor to Redis (blazing fast though) in master, but I want to read concurrent data (for charting) from a slave read-only replication (was my thought). This because when I do simultaneous write/reads then Redis will stall.

Some question:

  • Is it possible to setup a replica on the same OS - Host listening on another port?
  • Is this the way to solve the concurrent writing and reading in Redis?

Thanks in advance and with kind regards,
Ben

You can certainly run the master and the replica on the same machine with differing ports. In fact, the clustering and sentinel examples at redis.io, do that very thing.

However, a single Redis instance should have no problem with providing reads and writes unless you are absolutely soaking it with requests. Which, maybe you are. If you are, the above links should help.

If you’re not, then maybe there’s a tight loop in your application that doing something that’s using Redis more aggressively than you think. Without seeing code or more context, I’m not really able to do more than speculate on this.