I was reading how can we sync data between multiple nodes for in-memory cache.
I understand we can use centralised/distributed cache like Redis or Hazelcast, but given the limitation of an existing application(data-intensive, build on SpringBoot, java, MS SQL, high mobile usage) if someone want to implement his own data sync technique what are different ways.
I did some research but couldn't find anything concrete,I can find data sync between cache and database but nothing much on between mutiple nodes for in-memory cache.
I find one article which explain data synchronisation issue : In-memory cache VS. centralized cache in a distributed system
I also tried finding the internal implementation of Redis and Hazelcast cache how they keep data in sync across nodes, but they are abstracting the user from their algorithms.
I can think of following ways to do it:
- kafka pub-sub approach
- Rest API
- UDP multicast :https://en.wikipedia.org/wiki/IP_multicast
I would like to know if these approaches will work, when we have following restrictions:
- we cannot afford high data sync lag
- data loss delivery
- out of order