- I have a booking application where 3 to 4 devices are used for a single location. Many of these locations have bad internet connectivity, so the idea is to store data in localstorage of the device. I want the data sent by one device to go to server and then sent to other devices for them to store it locally.
- So at any point of time all the clients will have the data entered or sent from another other device for them to execute it without depending on the server. What will be the best way to implement this type of system. Where even if a single device do not have internet connectivity it should be able to get the data when internet comes. I tried socket.io and read aws message queue and redis also. But some expert advice in this will be very helpful for me.
1 Answer
Why don't you use a publisher/subscriber model like kafka/rabbitMQ, You have a producer and all apps are the consumers, the producer sends messages to its respective topics. All devices are consumers which would pull data from this topic. You can have multiple topics and can even join multiple streams to get a new stream. It is fairly easy to implement as well
rediswith a long enough TTL and design your clients in a way that it knows whether the data available onredisis fresh or stale.