#Redis Cluster - Deleting keys across a Redis cluster

2 messages · Page 1 of 1 (latest)

proud wadi
#

I'm currently working with a Redis cluster that consists of a primary node and a replica node. I've noticed that when I delete keys on the primary node, they still seem to persist on the replica node for a while.

I've been using the ioredis library in Node.js to interact with Redis, and I'm wondering what the best approach is for ensuring that when I delete a key on the primary node, it gets deleted across all nodes in the cluster, including the replica.

frigid surge
#

The deletion isn’t instantaneous—but if your code needs to know that the changes have been replicated, you could try the WAIT command (https://redis.io/commands/wait).