HeadlinesBriefing favicon HeadlinesBriefing.com

nanotdb: Tiny Edge‑Optimized Time‑Series DB for Raspberry Pi

Hacker News •
×

GitHub hosts nanotdb, a lean, append‑only time‑series database engineered for low‑power devices like Raspberry Pi and edge gateways. The project foregoes runtime dependencies, storing all data in plain files under a single root. Its architecture centers on a single Engine process that routes samples to named databases via a lightweight line‑protocol prefix for continuous monitoring.

Each database splits storage into a crash‑safe Write‑Ahead Log, a catalog mapping metric names to compact IDs, and partitioned .dat files that hold immutable, S2‑compressed pages. Ingesting a line like “prod/room.temp 21.5 1715000000000000000” appends a compact record to the WAL, then buffers the sample in memory before flushing a full page to disk for high throughput.

On startup, the Engine replays any pending WAL entries into the in‑memory page if the on‑disk data lags, using the catalog to resolve metric types. Queries walk daily partitions, skipping frames outside the requested window without decompression, then stream matching samples back via a callback, supporting stride‑based sampling for large ranges across time series data.

The project ships a small HTTP API compatible with VictoriaMetrics, plus an offline CLI for inspecting catalogs, WALs, and data files. A 64 MiB WAL segment size and optional fsync policies let operators tune durability against throughput. By keeping everything in user‑space files, nanotdb delivers persistent, low‑overhead telemetry storage for constrained edge hardware in production systems.