What it does
With KYNETRA_STORAGE_BACKEND=postgres the durable log is a table in PostgreSQL instead of segment files. Search, vector and document views are still rebuilt in memory from that log. A primary takes a fenced lease in the database before it may write, and read replicas share the same table.
How it works
The log lives in a table of sequence number, timestamp and the same MessagePack-encoded record the file log uses. A dedicated thread in the engine owns a database connection and bridges the engine's synchronous write path to the asynchronous driver. A local checkpoint cache and restore backups still use the data directory, but durability lives in the database.
A primary must hold a lease before it can write. The lease is a row in the same database, checked against the database clock, with a key (KYNETRA_PG_WRITER_KEY) and a time to live between 10 and 300 seconds (KYNETRA_PG_WRITER_TTL_SECS, 30 by default). Each append or truncate takes the lease-row lock through its own database transaction, allocates the next sequence number inside that transaction and commits, so the database, not a counter in the process, is the authority for sequence numbers. A holder whose lease was taken over after expiry is fenced and cannot write; a database trigger rejects writes that bypass the lease. A commit whose acknowledgement is ambiguous latches the writer as unready rather than guessing. The supported batch size is one, and larger values are rejected.
A replica opens the same table without write rights. It polls the table for new records and applies them, with no copy of the log of its own. For the PostgreSQL backend no primary URL is needed; the file backend requires one.
Optionally, KYNETRA_PG_VECTOR offloads vector search to the pgvector extension, with a typed column and an HNSW index when KYNETRA_PG_VECTOR_DIM fixes the dimension. If the extension is not available the engine logs a warning and falls back to its in-memory vector path.
TLS is used when the connection URL names a Neon or Supabase host, or sets sslmode to require, verify-ca, verify-full or prefer. Other URLs connect without TLS.
Where you reach it
- Config
KYNETRA_STORAGE_BACKEND=postgres, KYNETRA_PG_URL - Config
KYNETRA_PG_SCHEMA, KYNETRA_PG_WRITER_KEY, KYNETRA_PG_WRITER_TTL_SECS, KYNETRA_PG_BATCH (must be 1) - Config
KYNETRA_PG_VECTOR, KYNETRA_PG_VECTOR_DIM (optional pgvector offload)
Limits
- The tests that need a live PostgreSQL are opt-in and skip when no database is configured, so they do not run by default.
- No deployment profile in the cluster tooling sets this backend up. The deployment-fit catalogue marks restart durability on this backend as unproven and rejects the pg-ha-read profile today.
- Every write is its own database transaction, so write throughput follows the database round trip. No performance figure is published for this backend.
- The tiny-vps runtime profile, Raft and the native replication path do not combine with it.
- Connections to hosts other than the Neon and Supabase patterns use TLS when the URL asks for it, and otherwise do not.
Evidence
- On this siteDeployment target matrix
- TestsCovered in the engine repository by 5 backend tests and 8 writer-fencing tests (one concurrent owner wins, stale owner fenced after takeover, a replica without write rights cannot mutate, trigger rejects legacy inserts, ambiguous commit latches), all opt-in and gated on a live database
Test coverage is listed as present in the engine repository at this edition. This page does not report test results.
KynetraDB is in private preview
Request a preview to talk through the limits above against your own workload.