engines

AltSql Mesh Keeps Twelve Devices on One Table on a Farm With No Signal and No Gateway

Some places have no mobile coverage and nowhere to put a gateway. A big sheep farm is one. The people working it still need the same picture: which troughs are low, which gates are open, what jobs are waiting and how many sheep are where.

AltSql Mesh gives every device its own copy of one shared table. Each device writes to its copy as its owner works. Whenever two devices come within radio range they bring each other up to date, over a link that may lose messages. No device is in charge and nothing waits for a server. Once every change has reached every device, all of them hold the same table, row for row, and any device with the memory for it can answer SQL about it.

The AltSql Mesh demo: a farm map with twelve devices, troughs and jobs, and lines where devices are syncing.

What the Alpha Found

In the tests, fleets of 2 to 32 devices met at random over links that lost up to 30% of their messages. Every fleet ended with the same table on every device. When two devices met with nothing new to tell each other, the meeting cost 484 bytes in a fleet of 12.

Try It

Open the AltSql Mesh demo. Three utes, four quad bikes and five people on foot carry a device each. Run half an hour of work, then stop the writing and watch the differences shrink to zero. Ask two devices the same SQL question and compare the answers. Then pull the plug on one in the middle of a write.

Where It Stands

AltSql Mesh is one C file of 1,566 lines, built on AltSql Core. It works and is tested in simulation on a PC. It has not yet run on a microcontroller or over a real radio. The farm, the people and the radio in the demo are simulated. Twelve copies of the real engines run in the page, one per device.