What is KDBS?

v3.0.0

KDBS is an OLTP database engine that enforces the rules your data must obey inside the engine.

In this article

KDBS is a relational database engine for online transaction processing (OLTP): keyed reads and writes, short transactions, and joins along primary keys. It narrows its feature set to that workload, and uses what that saves to enforce, inside the engine, the rules that applications usually check in their own code.

Why the rules belong in the engine

An application keeps a list of things it must never get wrong: no duplicate ids, no group over its limit, no state change that skips a step. When each service checks these in code, every service and every author must get them right. When the engine enforces them, they hold for every writer: a service, a script or an agent.

What the engine enforces

RuleStatus
A primary key belongs to one row; a deleted row’s key stays taken until an explicit PURGEBuilt
Upper bounds per group on COUNT(*) and SUM(column) (CREATE ASSERTION)Built
Foreign keys, checked on writeBuilt
Durability chosen per transaction, with the possible loss statedBuilt
Allowed state changes for a columnConcept
Execute a retried request at most onceConcept

How KDBS runs a statement

  1. A client sends SQL over KWP/1, a binary protocol.
  2. The parser turns the statement into a fixed sequence of steps: the plan is chosen when the statement is parsed, and it does not change as the data grows.
  3. The steps run on the CPU core that the client’s session is on.
  4. Rows are stored in a B+ tree ordered by primary key. Structures the engine learns from the workload sit next to the tree and may make a query faster, but never change its answer.
  5. Changes are written to a write-ahead log, with the durability the transaction chose.

Next steps