- Published on
Albedo – single-file listenable document database in Zig
- Authors

- Name
- DeepHorus
Developer Askhat Saiapov has introduced Albedo, a new embedded document database written in Zig that stores all data in a single file. Announced as a Show HN project, Albedo is a BSON-native database with no server process or network round-trip. It offers both a Zig API and a portable C ABI.
Albedo stores documents, indexes, and metadata in a compact page-based file, using B+-tree indexes on nested and array field paths. Write-ahead logging provides crash recovery and MVCC reads, while cross-process streaming enables real-time subscriptions. The database is designed for local-first applications that need event-driven updates without a central server.
Key features include WAL-native replication with caller-owned transport, query-driven update expressions in the Zig API, and a portable core for Linux, macOS, Windows, iOS, Android, and WASM. Installation is simple via Homebrew with 'brew install klirix/tap/albedo'. Developers can build from source using 'zig build' and run tests with 'zig build test'.
The project fills a niche between full-fledged database servers and simpler key-value stores. Its BSON support and B+-tree indexes allow complex queries on nested data, while the single-file format simplifies packaging and distribution. The real-time subscriptions and replication make it well suited for collaborative and offline-first applications.
Saiapov has published a C header and task-focused guides under docs/, along with AGENTS.md describing the on-disk format, storage machinery, and concurrency model. The Show HN post demonstrates basic operations such as opening a bucket, inserting a BSON document, and iterating query results. Feedback from the Hacker News community may guide further development.
Albedo is pre-1.0, so the on-disk format and public APIs could change in future versions. The MIT-licensed project welcomes contributions and bug reports. As it approaches a stable release, Albedo may become a go-to choice for developers needing an embedded, real-time document database in Zig or via its C ABI.