Precomputing Keeps Dashboard Answers Ready in a SQLite File as the Data Arrives
Most dashboards ask the same few questions all day long: requests per endpoint, say, or this month’s usage for one customer. The usual setup recounts raw rows on every refresh, or ships every row to a hosted service that bills by the gigabyte.
Precomputing does the counting once, as the data comes in. You write a short policy that names the answers you want and says how long each level of detail should live. It compiles to plain SQLite triggers, so every INSERT keeps those answers current and reading one is a lookup. Old detail fades on your schedule; unusual events are kept whole.
The nice part for app developers is that it’s still just SQLite. Any SQLite tool opens the file, and the answers are plain views with nothing running beside them. When triggers get too slow, a Go engine runs the same policy and writes the same file, value for value.
The same language drives a usage meter for billing, where a retried request counts once and a closed month stays closed. It also drives a log reducer that keeps every line on site and sends upstream what a dashboard needs. An AI agent can ask the file for answers over MCP, too, instead of reading raw rows.
It’s version 0.1, checked hard on simulated data and not yet run on anyone’s production traffic. The platform page has the full picture and The Policy Language walks through a policy line by line. To see it run, the SQL demo puts three hours of simulated API traffic through a compiled policy in SQLite’s WebAssembly build, right in your browser.