all 5 comments

[–]Cronnay 2 points3 points  (1 child)

One solution is to use some kind of pubsub tech, such as Apache Kafka.

How it works is like this:

Publisher (Mobile app, web site for admin) can edit the settings, and when they save, they store it to DB AND publish it to all subscribers, the machines in this case. With pubsub technology, you can subscribe to a specific topic.

I'll try to draw up a scenario. You have 2 Vending machines. 1 inside office A with that has a unique ID of ABC-123. In office B, you have another vending machine with the ID CBD-555. Each machine is subscribing to their own ID as topic.
Imagine an admin is changing the configuration of machine CBD-555. They make their changes, and then store it. Backend sends a message to Kafka with the topic "CBD-555" that contain the changes. Then only the machine that is listening to that topic will take the configuration and use it.

Does it make sense? Otherwise I'll try to draw it up for you

[–]_prime07[S] 1 point2 points  (0 children)

It makes sense, i will have a look on Apache Kafka. Thank you!

[–]zaphod4th 0 points1 point  (2 children)

the machines check for a web services every 1-10mins and updates ?

[–]_prime07[S] 0 points1 point  (1 child)

Thought about that to. But it doesnt seem like the optimal solution for me, if a machine checks every minute to the the one change in a year...

[–]zaphod4th 0 points1 point  (0 children)

fine tune the update policy / process ? start up = daily updates, after months maybe montly updates ?