Developer beta 0.1.0-beta.1 documentation. The build is not available for download yet; these pages describe the beta as built and tested on Linux x86-64.

Architecture (user level)

 psql / libpq drivers ─── PostgreSQL protocol ──┐
 Rust / Python / TypeScript SDKs ── native protocol ──┤
 holadb shell / query / studio ─────────────────────┤
                                                    ▼
                                            ┌────────────────┐
                                            │  server        │  authentication, authorization,
                                            │  (one per dir) │  metrics, logs, audit
                                            └───────┬────────┘
                                                    ▼
      SQL text ─▶ parser ─▶ binder ─▶ planner ─▶ session (transactions, cursors)
                                                    ▼
                                            ┌────────────────┐
                                            │  store         │  catalog (schema), secondary indexes,
                                            │                │  write sets, commit journal
                                            └───────┬────────┘
                                                    ▼
                                            ┌────────────────┐
                                            │  engine        │  write-ahead log, sealed segments,
                                            │                │  persisted record index, recovery,
                                            │                │  storage representation controller
                                            └────────────────┘

Layers and what they promise

  • Engine. Every write is an append to a table’s write-ahead log, synced before it is acknowledged. Periodically the log is sealed into an immutable segment carrying content hashes; every segment file is checked against its hash when a table is opened, and a file that does not match stops the open (damage that happens while the server runs is found at the next start or by holadb verify). The engine keeps the current state of every row in memory and in a persisted index that is rebuilt whenever it cannot be verified. The engine knows nothing about SQL.
  • Storage representation. Sealed segments may be stored in a conventional form or in a compact representation the engine derives from the data. This is an internal decision made by a controller with explicit states and a journal; every representation is verified against the original before it is trusted, conventional storage is always the safe fallback, and nothing about it is visible in the SQL view, the protocol or the backup format. In this beta a table created through SQL is stored in the conventional form unless the compact one is requested with the engine-level commands; no saving of space is promised. You do not need to understand it to use HolaDB.
  • Catalog and store. The SQL schema (tables, columns with stable ids, primary keys, indexes) lives in the CATALOG file, written atomically. The store maps SQL rows to engine records, maintains secondary indexes, validates transactions at commit and journals multi-table commits.
  • SQL. A deterministic parser, binder and planner for a defined subset. Unsupported syntax is named, never guessed.
  • Server. One process per database directory; a thread per connection; one writer at a time. Native protocol (length-prefixed binary frames, request ids) and the PostgreSQL wire protocol share the same session layer. Users, roles, metrics, logs and audit sit here.
  • Clients. The SDKs speak the native protocol directly (no Rust internals, no generated code). PostgreSQL drivers need nothing HolaDB- specific.
  • Tools. Migration adapters read foreign databases with built-in clients and write through the same store as SQL does; backup works on files and a manifest; Studio is a plain client of the server.

Independence rules the code keeps

Layer Independent of
engine SQL, the catalog, the protocol
SQL how data is stored
protocol engine types
clients Rust internals
migration adapters storage internals (they use the SQL store)
backup format the network protocol

Each layer is a separate component with its own test suite.