Skip to content

Enterprise Architecture

Mohammad Rasoul Kazemi edited this page Nov 28, 2026 · 3 revisions

Enterprise Architecture

The high-level view: how the components fit together as a platform, and the roadmap phases as a capability map. States are those of Status and Roadmap, which follows kingres/README.md; where this page and the README differ, the README is right. The first release, 0.1.0, is being prepared.

The platform in layers

flowchart TB
    subgraph people["Users"]
        u1["Administrators"]
        u2["Applications"]
        u3["Auditors"]
    end
    subgraph mgmt["Management plane"]
        console["Web console"]
        rest["REST API, openapi.yaml"]
        kd["kingresd on every server<br/>agent, manager, client entry point, standby and failover logic"]
        sysdb[("System database")]
    end
    subgraph data["Data plane: PostgreSQL 18 or 19"]
        shard["kingres_shard<br/>distribution, 2PC, movement, standbys"]
        ledger["kingres_ledger<br/>hash chain and Merkle blocks"]
        analytics["Analytics<br/>sketch, timepart, columnar"]
    end
    subgraph trust["Trust plane"]
        sign["Signing keys and publication"]
        anchor["Anchoring"]
        ver["Standalone verifier"]
    end
    subgraph pack["Delivery"]
        pkg["Debian package and container image per major, amd64"]
    end
    u1 --> console
    u1 --> rest
    console --> rest
    rest --> kd
    kd --> sysdb
    kd --> shard
    u2 --> shard
    shard --> ledger
    shard --> analytics
    kd --> sign
    ledger --> sign
    sign --> anchor
    u3 --> ver
    ver --> sign
    ver --> anchor
    pkg -.-> kd
Loading
Plane What it does Where it is described
Data plane Stores and queries data across shard groups; keeps the ledger chain; offers analytics Sharding, Ledger, Analytics Extensions
Management plane One REST contract; a console; a manager leader per cluster that runs tasks, rebalance, failover, configuration Control Plane and REST API, Web Console, High Availability
Trust plane Turns the chain into signed, published and anchored evidence that a verifier that does not trust the database can check Ledger Signing and Publication, Ledger Anchoring, The Verifier
Delivery One package or image per PostgreSQL major Installing and Packaging

Capability map

"Done" means written, tested and reviewed where the work log says so; the state is that of kingres/README.md. The first release, 0.1.0, is being prepared.

Capability Phase Component State
Fork, branches, rebrand, licence 0 Repository Done
Hash-distributed and reference tables, routing, correct statements on several groups 1, 2 kingres_shard Done
Control plane, REST API, console, package 3 kingresd, web, packaging Done; REST contract 0.34.0
Moving buckets and rebalancing 4 kingres_shard, kingresd Done
High availability: standbys, leases, failover, automatic failover, switchover and hard failover of the map group, restore of preferred primaries, client entry point, CA key escrow (off until switched on) 5 kingres_shard, kingresd, kingres-watchdog Done; failover is new, test your recovery procedure
Ledger tables, digests, proofs, verifier 6 kingres_ledger 0.3, kingres-verify Done
Signing, publication, aggregate digest, client signatures, anchoring 7 kingres_ledger 0.3, kingresd, verifier Done, except an external signer command, publication mirrors and the anchor probe from another server (not in the first release)
Query pushdown, row router, colocated joins 2b kingres_shard Done
Atomic visibility of distributed transactions; multi-node ledger (witnesses, BFT notary) 8 n/a In design since 2026-11-28; not built, not part of the first release
Table lifecycle: distribute existing tables, undistribute, alter, distribute with related tables 9 kingres_shard 0.9, kingresd Done
Elasticity: split a bucket, weights, strategy by disk size, drain a server (with the map group hand-over), automatic mode 10 kingres_shard, kingresd Done
Distributed schemas 11 kingres_shard, kingresd Done
Real-time analytics: approximate aggregates, columnar storage, time partitioning, repartitioned joins, MERGE 12 kingres_sketch 1.0, kingres_timepart 0.3, kingres_columnar 0.2, kingres_shard Done
Configuration from the console: PostgreSQL parameters at three levels, time 13 kingresd, web Done
Export and import of a table (CSV) and of a database (archive) 14a, 14b, 14c kingresd, web Done
Hardening of the extensions, pg_stat_statements and PL/pgSQL in every database n/a extensions, kingresd Done
Management of third-party extensions 15 kingresd, web Designed; after 0.1.0, not part of it

Dependencies between phases

flowchart LR
    p3["3 Control plane"] --> p4["4 Rebalance"]
    p3 --> p13["13 Configuration"]
    p2["2 Distributed DML"] --> p2b["2b Pushdown"]
    p4 --> p9["9 Table lifecycle"]
    p2b --> p9
    p4 --> p10["10 Elasticity"]
    p5["5 High availability"] --> p10
    p9 --> p11["11 Distributed schemas"]
    p4 --> p11
    p2b --> p12["12 Analytics"]
    p6["6 Ledger"] --> p7["7 Signing and anchoring"]
Loading

Dependencies are those of the table in architecture.md, "Phases 9 to 12"; phase 13 depends on phase 3 only.

How the pieces cooperate

  • A write to a ledger table in a sharded database is captured by kingres_ledger on the group that owns the row; one chain exists per shard group, and phase 7 adds an aggregate digest over the chains. A consistent cut across groups is not provided.
  • kingresd on the manager leader reads closed blocks, builds logs and signed checkpoints, publishes them and anchors the aggregate; nothing is on the commit path.
  • The verifier pins what the auditor holds and treats everything the server says as a claim.
  • Rebalance, failover, configuration, transfers and ledger jobs are tasks of one engine with fencing epochs, so a task that lost its term cannot act.
  • Constraints that cross phases: a columnar table can be distributed and its buckets moved (with kingres_columnar 0.2), but it cannot be split and the online variants of the table operations are refused; a ledger table cannot be columnar, distributed or made a reference table; a distributed schema that holds a ledger table cannot be moved or drained.

Sources

Clone this wiki locally