Am I using consul correctly?

Hey all,

So I am working on a payments system where I want to be able to share data across multiple identical devices over LAN. Don’t want to deal with centralized cloud servers as these need to work without WAN connection. So imagine a grocery store with multiple lanes and each node or system is identical. Without having a master back office server, ideally all these systems would be interconnected with some type of framework mesh that can share data across all nodes.

These systems would talk to their own databases but then whenever you ring up an item, save the sale, go over to a different node, I want to be able to pull up that saved sale.

Essentially a zeroconf database cluster across same network machines.

I have toyed with consul KV which works great but still one device needs to be the master server. Consul works pretty well but feel as though I’m not really using it for it’s intended purpose. I have also trying spinning up each system as a server instance and bootstrap them all together and that works but it’s all multi server.

Depends on what exactly you’re trying to sync. Is it just a token or a small block of data or is it a full inventory of the system? Is the data transient or needs to be perpetual?

There are very few instances where consul would fit into that but it is possible.
The likely use is that you want each “isle” to be registered and discoverable by the other isles in your store – that’s where consul would come in.

Thanks for the reply @aram. Correct me if I’m wrong but would this setup still require an extra piece of hardware that acts as the “master” server that coordinates and registers each aisle as a client?

The data would have to be persistent in case of a system reboot.

Consul uses raft protocol to duplicate the data across all the nodes, so yes, you do need to have 3 or 5 consul instances to make it “HA” – but no other “hardware” is required … a load-balancer would be nice but you can do without it using round-robin DNS (which consul itself can register the services as).

But if I am installing this system into a store that has 5 isles as an example, one of those still needs to be dedicated as a server or master agent and the rest run as client agents, no? For the sake of argument, this doesn’t talk to the cloud so that will be no cloud server instances of consul. All local and all just talking to each other.

If they all are on the same network then somehow, from hours away during the install process they’ll have to figure out the server agents ip so they can join into the cluster. I’m thinking consul might not be the tool for this job however awesome it is. I don’t think a zeroconf/mdns auto join type of system exists.

There is no metadata with the service registration so not that I can see. You would need to have some sort of external service to be able to locate that service after the fact – DNS itself does have metadata tags, but AFAIK there is no way to feed that via consul.