Live Demo
Three simulated devices run the real AltSql Alpha engine right here in your browser. Each one keeps its own records and decides for itself. Only what matters goes to its gateway, where the same records arrive byte for byte. The demo is open to everyone: there is no sign-up, nothing to install, and nothing you do here leaves this page.
Simulated devices, real Alpha engine. The sensors, networks and flash chips are simulated. The database is the Alpha engine itself, compiled to WebAssembly.
How to Run It
- Press Play. A machine sensor, a truck’s cold-chain logger and a soil sensor start together. Their hour, two days and month of readings pass in about 45 seconds.
- Pull the plug. Cut the power on one device with its own button, or on all three at once. Each one reboots, checks its records and carries on.
- Review the results. The run finishes at full speed. You see the bytes stored and sent, one record found on both device and gateway, and every check after a cut.
- Ask the gateways. Run a ready-made SQL question or write your own. Then try the power-cut lab at the bottom of the demo.
On a wide screen the demo can show the three devices side by side: open it full screen.
The Controls
| Control | What it does |
|---|---|
| Play, Pause, Resume | Starts the run, pauses it and carries on. An uninterrupted run takes about 45 seconds. When it ends, the button reads Play again |
| Stop | Ends the run and puts all three devices back at the start |
| Pull the plug | Cuts the power on all three devices at once, whatever they are doing. It works while the run is playing |
| Pull this plug | On each device card: cuts the power on that device alone |
| Review the results | Finishes the run at full speed if it is still going, then opens the results, the byte-for-byte check and the SQL questions |
Reading a Device Card
- The badges show the power (on, cut, rebooting or done), the link, and the device’s own state: its fan, an excursion or its valve.
- The chart draws each reading as it is saved. Dashed red lines mark the rule’s limits and the strip along the top marks the device’s state. Shading shows when the link was down or up, small ticks mark messages sent, and a red line marks each power cut.
- The three bars compare every reading as JSON, every record as the engine stores it, and the bytes actually sent over the weak link.
- The log lists what the device decided, what it sent and what it found after each reboot, newest first.
The Three Devices
Machine Sensor
- Measures a machine’s temperature, once a second for one hour.
- Decides on its own: above 60 °C for 10 seconds, alarm and fan on. Back under 55 °C, both off.
- Link: Wi-Fi, down from minute 20 to 35. Gateway A receives every record. Gateway B, standing in for a constrained link, receives the minute summaries and the fan state.
The machine monitoring case study follows this device through its hour.
Cold-Chain Logger
- Measures the temperature of a load in a refrigerated truck, every 30 seconds for 48 hours, and whether the door is open.
- Decides on its own: above 8 °C for 15 minutes, excursion recorded and driver alerted. The excursion closes when the load is back to 8 °C.
- Link: mobile coverage only at depots, where the cloud receives 15-minute summaries, excursions and the status. On arrival the dock reads out the full log.
The cold chain case study follows the trip.
Soil Sensor
- Measures soil moisture and soil temperature, every 15 minutes for 30 days.
- Decides on its own: moisture averaging under 20% for an hour, valve opens. Back to 35%, it closes.
- Link: one radio message a day of at most 51 bytes, which carries the day’s 38-byte summary to the farm office.
The agriculture case study follows the month.
Things to Try
- Let one run finish untouched. Press Play and wait, or press Review the results at once. With no power cuts, the results match the numbers on the Alpha page exactly: 2,533, 6,810 and 1,140 bytes sent over the three weak links.
- Pull a plug at a key moment. Pause as a device nears one, then Resume and pull its plug: the machine sensor during a hot spell (around minutes 5, 27 and 48), the logger during its excursion (22h27 to 23h18), or the soil sensor while its valve is open (days 10, 14, 18 and 30). After the reboot the device reads its fan, status or valve back from its own database.
- Pull plugs again and again. Every reboot checks every record the device had reported as saved. Each card counts the cuts it survived, and the results table shows how the checks went.
- Look at the bytes. Under Byte for byte, the newest record each gateway received is laid out field by field, with where it sits in the device’s flash and in the gateway’s. The bytes are the same in both places.
- Ask your own questions. Pick a ready-made question, change it or write a new one, then press Run (or Ctrl+Enter, ⌘+Enter on a Mac). The list below says what each gateway holds.
- Run the power-cut lab. Choose 1,000, 10,000 or 100,000 cuts. It is the Alpha’s own power-cut test, running in your browser, with every check counted.
What the Gateways Hold
The gateways answer SELECT with WHERE, GROUP BY, HAVING, ORDER BY and LIMIT, and functions such as COUNT, SUM, AVG, MIN, MAX and ROUND. They refuse writes, because a gateway changes only through sync. Times count from the start of the run, in seconds, except in the machine sensor’s minute summaries, which count minutes.
- Gateway A receives every record from the machine sensor. Tables:
raw (time, temp),minute (time, min, avg, max)andkv (key, value). - Gateway B receives the machine sensor’s minute summaries and fan state. Tables:
minuteandkv. - Cloud receives the logger’s 15-minute summaries, excursions and status, sent at depots. Tables:
quarter (time, min, avg, max),excursion (time, minutes, peak)andkv. - Dock receives the logger’s full log, read out on arrival. Tables:
raw (time, temp, door),quarter,excursionandkv. - Farm office receives the soil sensor’s daily summaries by radio. Tables:
day (time, min, avg, max, irrigation)andkv.
What the Numbers Mean
- Every reading as JSON: what the device would send if it shipped each reading as a small JSON object. The baseline is lean on purpose, with no MQTT, HTTP or TLS overhead.
- Every record, as stored: every record the device wrote, in the engine’s own format. These are the bytes a gateway receives when it gets everything, as gateway A and the dock do. For the soil sensor the figure is computed, at 30 bytes a reading.
- Sent over the weak link: what actually went over the constrained link, meaning summaries, decisions and settings. The results compare it with the two figures above.
- Write in flight, saved in full or not at all: when the power goes in the middle of a write, that one record is either complete after the reboot or absent, never half-written. Everything saved before it is still there.
- Old rows rolled over: when the flash fills, the oldest time-series rows make room for new ones, oldest first. Settings are kept.
What Happens at a Power Cut
The card goes dark and says what the device was writing at that moment. About a second later it reboots: the engine opens its database and checks every record, and the page compares them with everything the device had reported as saved. The device then reads its own state back from its records and carries on from where it was. A cut can cost only the record being written at that moment, so after a run with cuts a few totals differ slightly from the published ones.
If It Does Not Start
The demo works in any current Chrome, Edge, Firefox or Safari, on a computer or a phone, with JavaScript switched on. It needs WebAssembly, which all of them support. The engine comes with the page, about 220 KB, and runs inside it. If the demo says the engine could not start, try another browser, or allow scripts on this page if an extension blocks them.
In testing no check has failed. If one ever does, the device card and its log say so in red, and the project would be glad to hear about it through the contact page.
What Is Real Here
Real:
- The database engine: the AltSql Alpha, the same code measured on the Alpha page, compiled to WebAssembly so it runs in your browser.
- Every byte the devices store and send, and every byte the gateways keep.
- The checks after each power cut, and the answers to SQL questions.
Simulated:
- The sensors and their readings. They follow a fixed script, so a run without power cuts ends with the published Alpha numbers.
- The networks, including lost messages, and the flash chips, emulated in memory the way the engine sees real NOR flash.
- Time: an hour, two days and a month pass in under a minute.
Next, in the Beta, the same engine runs on real boards from five chip families, with real power cuts. The roadmap has the plan.