Portfolio
Case study
KDBS — an OLTP database for modern software
2026
Problem
Applications enforce, on top of the database, rules that must never be broken. There must be no duplicate ids, a group must not exceed its limit, and no child row may exist without its parent. These checks are repeated in code, once per service and once per author. As more code is written by agents, the scattered rules become a matter of probability: they may hold, or they may not.
Approach
We built a new OLTP engine in which a rule is declared once in the schema and enforced by the engine. It gives up generality and narrows its scope to key-based reads and writes, short transactions and low tail latency.
- Identifiers issued once. A 48-bit primary key never points to a different row after it is committed. A stored id cannot point to the wrong row.
- Group limit assertions. SQL-92
CREATE ASSERTION, which no major DBMS enforces, is implemented in a form restricted to per-groupCOUNT(*)/SUMupper bounds. A write that violates one is rejected before it runs, by an O(1) check. - Execution plans that do not change. Every statement is compiled into a chain of steps at parse time, and statements of the same shape always run with the same plan.
- Learning that does not change results. The engine records the access paths of repeated queries, and builds and drops lookup structures for the observed values on its own. If every learned structure is deleted, the results stay the same and only the speed drops. A dedicated test suite verifies this invariant.
- Selectable durability. Each transaction chooses
strict/group/relaxed, and the loss window of each level is stated explicitly. The engine has a WAL, page checksums, full-page images and recovery at mount. - Thread-per-core architecture. Each core runs one C++20 coroutine reactor, and all I/O passes through an injectable device layer, so the whole engine runs under deterministic simulation.
Result
- Since July 2026, about 1,800 commits have produced roughly 110,000 lines of engine source and roughly 100,000 lines of tests.
- The engine guarantees primary keys, group limits, foreign keys, durability levels and fixed execution plans.
- Failure paths are verified by actually executing them with deterministic injection, and features that are not implemented are documented at the same level as those that are.