1

Should I use Redis Pub/Sub or Redis Stream to solve the following problem?

  • Each device has its own MYSQL database
  • Each database need to be synced up between each other

Consider there are some cases of

  1. At some time, more than one devices will be offline. When it online, data need to be the latest version
  2. What if the data fail to update?
  3. Data delay while communicating
  4. Real-time communication between devices

Please advise the best suggestion to solve the sync up problem.

Reference: What are the main differences between Redis Pub/Sub and Redis Stream?

1 Answers1

0

From your description it seems like you need a reliable method like Stream (pub-sub is not). Pub-Sub is a fire and forget method if the communication is down you might loose notifications. While Stream has a more reliable mechanism that supports at least once delivery.

You might want to check the rgsync recipe for RedisGears that provides a Redis Module that does it .

Guy Korland
  • 9,139
  • 14
  • 59
  • 106