0
  • 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.
4
  • 1
    You can store your data in redis with a long enough TTL and design your clients in a way that it knows whether the data available on redis is fresh or stale. Commented Aug 8, 2017 at 7:42
  • you can use just any database for your choice, or if you really need a queue here - you can try a nodejs library npmjs.com/package/kue; Commented Aug 8, 2017 at 8:15
  • also you can look at pouchdb.com - it provides 2 types of databases - one for client another for server - and they have a mechanism to sync data between them - you will need just put data into client database and the library does all the work when the device is connected to to the internet. Commented Aug 8, 2017 at 8:18
  • I think you are looking for a PUSH/PULL architecture documented here: learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/patterns/… you could also implement something much simpler by having your base application send messages to multiple queues, one per client. Your downstream consumers would then process the data and send a message to another queue where that downstream service actually did the verification that it has received a 'work completed' message from each of the servers that have to process the message. Queues are light and easy to create to allow for this. Commented Aug 8, 2017 at 16:57

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.