Durability Levels (strict, group, relaxed)
Whether a "commit succeeded" response means "written to the device" or "will be written soon" differs by DBMS and by setting. KDBS names three levels and states what the response promises and what range can be lost. The level applies to the COMMIT of statements that write log records (INSERT, UPDATE, DELETE). An explicit transaction waits once at commit, not once per statement.
Key Specifications
| Level | Other name | Commit response | Range that can be lost |
|---|---|---|---|
strict | D1 | Responds after fsyncing the WAL | None |
group | D2 (default) | Responds after writing up to the same point as strict. The transactions committing at the same time share the fsync | None |
relaxed | D3 | Responds immediately. The WAL drain syncs every wal_drain_interval_us (default 1,000µs) | Commits within that interval |
| Setting or statement | Scope |
|---|---|
durability = group (setting) | Instance default |
| `SET DURABILITY {STRICT | GROUP |
BEGIN … DURABILITY <level> | One transaction |
SYNC | Syncs the log and storage now (admin) |
READ ONLY transaction | Independent of the level, because it writes no log. COMMIT finishes immediately |
The manual explains why SET DURABILITY does not apply retroactively to an open transaction: a transaction that has already written log records under a D3 window cannot later be given the D1 promise. A window that has been written is written.
In the Sandbox
The load script inserts data with SET DURABILITY RELAXED and runs SYNC at the end. The data can be recreated from the script, so there is no reason to wait on every commit. Sandbox runs are READ ONLY transactions, so they leave no log.
Checkpoint and Recovery
A checkpoint writes dirty pages every checkpoint_interval_ms (default 5,000ms). Recovery runs at mount time, and every commit that was acknowledged under strict or group comes back. If the log device refuses a write or a sync, the engine rejects every write statement after that (wal_stopped=1), and only a restart makes writes possible again. A rejected COMMIT is also recovered if its record had already reached the device.
Comparison with Other DBMSs
| Immediate fsync | Group commit | Respond first | |
|---|---|---|---|
| KDBS | strict | group (default) | relaxed |
| PostgreSQL | synchronous_commit = on (group commit via commit_delay) | synchronous_commit = off | |
| MySQL InnoDB | innodb_flush_log_at_trx_commit = 1 | Binary log group commit | = 2, = 0 |
| Oracle | COMMIT_WRITE = WAIT | LGWR writes in batches | NOWAIT, BATCH |
| SQL Server | Default | Batches log flushes | Delayed Durability |