DWQA QuestionsCategory: DatabaseDouble Redis Real-time Data Synchronization Scheme?
dirax asked 1 week ago

A program A in a host Master generates data, and program A in standby Slave needs to access the same data as in Master.
Because of the high speed of data access, we plan to use Redis to store data on Master and Slave. So how to synchronize data on Master to Redis on Slave? And when the data on Master is added or deleted, Slave can also make corresponding data changes.
My current idea is to connect Master and Slave via TCP and write a trigger. When program A in Master adds or deletes data to Redis, it sends a signal (including actions and data) to Slave, and then Redis in Slave makes synchronous actions.
Excuse me:

  1. Is this idea feasible?
  2. If feasible, how difficult is it to achieve? Can data be consistent? What are the problems that need attention?
  3. If not, are there alternatives?

Redis beginners, I hope you will not hesitate to give advice, thank you.

4 Answers
sanix answered 1 week ago

Redis itself supports master / slave.

Vicky answered 1 week ago

Redis itself supports primary and standby modes, but standby is not writable and can only be read. The standby will automatically synchronize from the main library

Vicky replied 1 week ago

The master library synchronizes client operations to slave Libraries

Randy answered 1 week ago

Avoid network latency

for_freeedom answered 1 week ago

The author asks for real-time. The master-slave data or other examples require real-time synchronization of subscription events similar to redis-cli. The data of several main memory databases are internship synchronization.