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.
- Is this idea feasible?
- If feasible, how difficult is it to achieve? Can data be consistent? What are the problems that need attention?
- If not, are there alternatives?
Redis beginners, I hope you will not hesitate to give advice, thank you.
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
The master library synchronizes client operations to slave Libraries