The Modules

AltSql’s modules each take its native hybrid of key-value and SQL to one more job. AltSql Core is the base: the key-value door on the device and SQL on the gateway, with the same records on both. AltSql DB is the gateway’s database, with both doors onto one file for a whole fleet. Six more modules take the same idea to one problem each, in how devices keep, search and share their data. Everything so far runs on a PC: none of the modules has run on a microcontroller yet, and that is the job of the Betas, AltSql Core’s first.

All of them serve the same premise. Devices keep working and deciding when the connection drops. Results and alerts go upstream instead of every raw reading. Devices act on their own data, with no round trip to the cloud. One format and one sync protocol run from sensor to cloud.

AltSql Core: The Foundation

Key-value and time-series storage on the device, SQL on the gateway, and the same records on both, copied byte for byte. A sensor keeps its readings and settings in its own flash, decides on the spot and keeps working when the link drops; its gateway answers SQL over the very same records, with no converter in between.

It is one C file of 3,907 lines. The sensor build, with key-value, time-series and sync, takes 14,954 bytes of code as compiled for a Cortex-M4, and the three demo devices use 672 to 1,048 bytes of engine RAM. In one test run the simulated power was cut 400,000 times with nothing saved lost, and the tests caught 16 of 16 deliberately planted bugs. It has not yet run on a microcontroller.

The Alpha results, the technical brief and the live demo

Six Modules Built Around It

Each module is one C file with its own tests and live demo. Four are layers on top of AltSql Core and keep their data in it. Two are storage layers of their own and use none of Core’s code: AltSql Instant writes Core’s records and speaks its sync, so a gateway running Core takes them as they are, and AltSql Realtime shares only Core’s flash driver interface.

Module What it adds How it relates to Core Lines of C Tested in
AltSql Ask Questions put to a whole fleet; only the answers travel A layer on Core: it runs over each device’s Core records 1,923 Simulation on a PC
AltSql Vector Vibration fingerprints, matched to what it was taught A layer on Core: its fingerprints live in Core’s store 931 Simulation, and recorded vibration
AltSql Wave Raw vibration bursts, lossless and searchable A layer on Core: bursts and features in Core, features sent by Core’s sync 1,550 Simulation, and recorded vibration
AltSql Mesh One table shared by a fleet, with no gateway A layer on Core: each device’s copy is its own Core database 1,566 Simulation on a PC
AltSql Realtime A limit on every write, for a control loop Its own storage layer and records; shares Core’s flash driver interface, none of Core’s code 974 Simulation; chip times from a datasheet
AltSql Instant Storage for MRAM and FRAM, kept the moment a write returns Its own storage layer, none of Core’s code; writes Core’s records and speaks its sync, so a Core gateway takes them 1,270 Simulation; chip energy from datasheets

AltSql Ask

AltSql Ask lets a gateway ask a whole fleet of devices one SQL question. Each device works out its own share of the answer from its own records, within limits the question carries, and sends back a small answer: 23 to 45 bytes for most of the demo’s questions. The gateway merges the answers into the rows the same SQL would give over all the raw data.

The live demo

AltSql Vector

AltSql Vector lets a device learn what a machine sounds like. It turns each stretch of vibration into a 32-byte fingerprint, names what it hears by the closest fingerprint it was taught, and flags what it was never taught. Taught only a normal bearing, the Alpha flagged every fault fingerprint in nine fault recordings of a public bearing data set, at each of two loads, and none of 55 normal ones; with so few normal ones, a false-alarm rate of a few percent cannot be ruled out.

The live demo

AltSql Wave

AltSql Wave lets a device keep the raw signal. It stores short bursts of vibration compressed without losing a bit, works out the figures an analyst looks at first while the samples arrive, and makes them searchable with SQL on the device or on a gateway, which can then fetch the raw burst behind any row. On 94 channels of a public bearing data set, its bursts came out 2.3% larger than FLAC at its default level and 23% smaller than xz at its strongest.

The live demo

AltSql Mesh

AltSql Mesh lets the devices of a fleet share one table with no gateway or server. Each device writes to its own copy, and whenever two come within radio range they bring each other up to date. In the tests, fleets of 2 to 32 devices meeting at random over links that lost up to 30% of their messages all ended with the same table, and a meeting with nothing new cost 484 bytes in a fleet of 12.

The live demo

AltSql Realtime

AltSql Realtime is storage for a control loop: every write has a limit on its flash work, worked out from the configuration before the device runs, and no write ever erases. The one call that erases runs when the application has time for it, with a flash driver that lets the chip erase in the background; the demo models such a driver. On a model of a common flash chip, with times computed from its datasheet, ten seconds of a loop writing every 10 ms missed none of their 1,000 deadlines, while the same loop on AltSql Core missed 76 at the chip’s typical timings and 829 at its slowest.

The live demo

AltSql Instant

AltSql Instant is storage for MRAM and FRAM: each record sits in a fixed place and is updated there, and a write is kept the moment its call returns. Its records are AltSql Core’s, byte for byte, so a gateway running Core takes its sync batches as they are. In the demo, with 500 µW of light and a 2,200 µF capacitor, a sensor with no battery saved 1,428 readings in a minute with Instant on MRAM, and 220 with AltSql Core on NOR flash; the energy comes from the demo’s model of the chips.

The live demo

On the Gateway: AltSql DB

AltSql DB is the next step of Core’s idea, on the gateway. Devices keep running AltSql Core, and a gateway that serves a whole fleet keeps their records in AltSql DB: every device in one file, each payload stored byte for byte, read by key with no SQL step or with SQL that uses the keys. It is built on Core, as AltSql Ask is, and Core stays as it is. In the Alpha, its keyed reads came out 5 times as fast as SQLite through SQL, it ran AltSql Core’s one-million-row queries faster than Core’s own gateway copy on all five of them, and its file opened at a commit after each of 3,354 power cuts.

The live demo · About AltSql DB

Coming Later

AltSql Private, for totals across devices without their individual readings, is on hold until an outside security review.

The Reports, and a Pilot

Each module has an Alpha report that sets out how it was built and tested, and how each figure was measured or computed. The reports go to device makers and investors on request, through the contact page. Device makers who want to see AltSql Core on their own board can plan a hardware pilot. AltSql Core and AltSql DB are open source under the Apache License 2.0, and the code is on GitHub. The other modules are prototypes, all rights reserved.