AltSql: Gives IoT Devices a 15 KB Database That Keeps Working When the Link Drops
Anyone who has built the software side of a connected product knows the integration job. The device keeps its readings and settings in one format and the gateway or cloud service wants those same values as rows in a SQL database. Somebody writes a converter. Then somebody has to keep that converter alive for as long as the device stays in the field, which for industrial equipment or embedded systems can easily be ten years. The converter has to handle offline periods, retries, out-of-order updates, and the device’s own data format changing over time.
AltSql takes the converter out. Its base engine, AltSql Core, compiles to about 15 KB of code for a microcontroller. The device keeps its readings and settings in its own flash storage and goes on making decisions from its own data when the connection drops. Its gateway stores the very same records, byte for byte, and answers SQL over them. When the device reconnects, the two sides reconcile their copies without collision detection or merge conflicts.
For app developers this moves logic around in a useful way. A rule like “switch the fan on if the last ten readings were all above 60 degrees Celsius” runs on the device itself, with no round trip to a server and no latency. The dashboard queries the same ten readings in plain SQL on the gateway. The rule fires instantly on the device; the dashboard sees the result when it next polls. The How It Works page shows both halves: a few lines of C on the device, one SELECT on the gateway.
The upshot is that your device doesn’t stall when the network is slow or down. It keeps working. Rules run locally, readings get stored locally, and when the connection comes back, the gateway already has the data and the history is consistent.
Six prototypes are built around Core, and the engines page lists them all. AltSql Ask puts one SQL question to a whole fleet of devices and brings back only the answers it needs. AltSql Mesh lets devices share a table with no gateway at all; they synchronize peer-to-peer. The flexibility comes from having a real SQL database on the device itself, not a message queue or a dumb sensor.
The architecture makes sense for products that need to be reliable in the field. The device is independent; the gateway is independent; sync is automatic. If the link goes down for days, the device is still answering its rules and storing its data. When the link comes back, reconciliation is conflict-free because the same data format and schema live on both sides.
The project is at Alpha. So far everything has run on a PC with the flash chips and radio links simulated in software. Real chips and radios come with the Beta. The live demos run the actual AltSql engine in your browser, compiled to WebAssembly, and you can cut a device’s power in the middle of a write to see what survives and what resynchronizes when power comes back.
Device makers who want to try it on their own board, on their own hardware, can plan a pilot with the team.
For anyone building a device that has to work offline, has to survive power loss, and has to answer questions over its data, AltSql moves the problem from “how do we keep this converter alive for ten years” to “we have a database on the device and the gateway that are always in sync.” That’s a much easier problem to live with, and it’s why AltSql’s footprint matters: 15 KB on a microcontroller is nothing, and the device gets a real database in return.