Repository navigation
Architecture Risks and Technical Debt
This page is arc42 chapter 11. It collects the limits and risks that the repository states for the first release: limitations.md, the "Known limitations" of the changelog (section 0.1.0, published on 2026-11-28), and the risk table of architecture.md. Those documents are the authority; when they change, they win. For the user-visible view see Limitations and Known Issues; for the phases see Status and Roadmap. The reviews of each part and what they found are in kingres/docs/reviews and the work log. Section 4 answers the objection that a fork of PostgreSQL has to maintain a database engine of its own, with what was measured in the tree.
| # | Area | Limit or risk | Source |
|---|---|---|---|
| R1 | Consistency | No global snapshot: a statement that spans shard groups reads each group at its own snapshot, so a reader can see a transaction's effects on one group before another; SERIALIZABLE is per node only. Atomic visibility of distributed transactions is phase 8, in design and not built (it is not a global snapshot) |
ADR 0009, limitations.md |
| R2 | Ledger | One ledger chain per shard group with the aggregate digest of phase 7; no multi-node ledger with consensus (phase 8, in design, not built) | limitations.md |
| R3 | High availability | Failover is new in this release: test your recovery procedure on your own cluster. Automatic failover is off by default. Two failures at once, and a failure during a rebalance, are not tested on a cluster. A cluster of one server has no failover. A failover cannot restore data that no standby had; a real request must accept that explicitly | limitations.md, changelog |
| R4 | Map group failover | A hard failover or a planned switchover of the map group whose candidate then dies cannot be released through REST when the map group has only one standby (every REST call answers 503). The way out is the local command kingresd -release-map-hold -lost <serverId> -accept-data-loss on the server of the old leader. The declaration lostServerId needs a second standby, a session with a SCRAM password and a current cache of the administrators' keys (admin-keys-max-age, 72 hours by default) |
limitations.md, ADR 0026 |
| R5 | Certificate authority key | The escrow of the CA key is off until an administrator switches it on; a server that holds a copy can become the authority. Without it the new leader after a map group failover raises certificateAuthorityUnavailable until the operator restores pki/ca.key and pki/revoked.json from a backup. There is no automated backup of the key |
limitations.md, operator guide |
| R6 | Transfers | Table CSV transfer is off by default, needs TLS and is limited to 2 GiB of decompressed CSV (256 MiB for a reference table). A database export and import carry no roles, grants, functions, triggers, policies or large objects; a ledger table restarts its chain (ADR 0028). A change of the manager leader at every step of a table transfer or of a database import is not tested on a cluster. An import that cannot go on is paused and needs an operator; the rules are in limitations.md | limitations.md, changelog |
| R7 | Anchoring and publication | Anchoring to RFC 3161 authorities and OpenTimestamps was tested against local fakes only. In release 0.2.0 the check anchors of a verification and a scheduled audit of the publication are not built; both are built in release 0.2.1 (phase 18, task 1; they are the server looking at its own evidence, not the independent check). Not in the first release: an external signer command, publication mirrors and the anchor probe from another server |
limitations.md, changelog |
| R8 | Ledger | A check inside the database is relative to a digest kept elsewhere. A database can be dropped with its ledger by every role that has the privileges of its owner or can SET ROLE to it. After a restore of the system database the operator accepts the loss and the logs fork against what was published (ADR 0025). The signing key's passphrase and the private keys must be backed up by the operator, apart from each other |
limitations.md |
| R9 | Sharding | The row-moving distributed scan is slow for large tables by design; it is the fallback that answers every statement. Pushdown makes some differences visible (a cursor without SCROLL cannot scan backward; a pushed statement can fail with KS001; floating point aggregates can differ in the last digits). A number of shapes are not pushed or are refused (UPDATE ... FROM and DELETE ... USING across tables in 0.1.0 and 0.1.1, which run on the groups from 0.2.0 (2026-11-30), some MERGE shapes). The number of buckets is fixed at creation; a bucket split cannot be undone |
ADR 0022, limitations.md |
| R10 | Columnar storage |
kingres_columnar is append-only (no UPDATE or DELETE), has B-tree indexes only, no TOAST and no vectorised execution; CREATE INDEX CONCURRENTLY and REINDEX CONCURRENTLY are refused. It must be preloaded by every instance for as long as its WAL exists; restart the standbys of a group before its primary |
limitations.md, packaging README |
| R11 | Time partitioning | A REPEATABLE READ or SERIALIZABLE transaction whose snapshot is older than a conversion and has not read the table yet sees the converted partition empty. Retention and conversion of columnar partitions need kingres_columnar 0.2 on every server |
limitations.md |
| R12 | Upgrade | A cluster runs one PostgreSQL major; there is no move between majors. A planned switchover must not run while servers of two versions run | limitations.md, Upgrades |
| R13 | Packaging | Debian package and container image for amd64 on Ubuntu 24.04 in 0.1.0 and 0.1.1 (no RPM there); since 0.2.0 also an RPM for the RHEL 9 and 10 families and Fedora, tested on AlmaLinux 9 and 10 and Fedora 44 and 45 and not with SELinux enforcing; no arm64. Packages and images are not signed (the checksums are signed since 0.1.1), there is no apt or dnf repository, no SBOM, and the images of the releases are on Docker Hub (kingres/kingres), not in a registry of the project. No automated backup and no point-in-time recovery configuration |
limitations.md, changelog |
| R14 | Console and control plane |
kingres-cli is part of release 0.2.0 (2026-11-30; Command Line Client); 0.1.0 and 0.1.1 have none. The Extensions tab shows whether an extension is preloaded but not its install state in a database. Some table operations started on another server's instance are not shown, and a server that went back to the last good configuration file is not shown as such (both marked Open in limitations.md) |
limitations.md |
| R15 | Legal | The name deliberately avoids the PostgreSQL marks; a legal review of the name is still open | limitations.md |
- The WAL resource manager id of
kingres_columnaris no longer experimental: it uses the registered id 255 (KingresColumnaron the PostgreSQL wiki list of custom resource managers). WAL that a development build wrote under the experimental id 128 is not replayed by this version. - Failover of the map group, the planned switchover of the map group, the hard failover while its server is alive, and the escrow of the CA key are built.
- Phases 9 to 13 and 14 (table lifecycle, elasticity, distributed schemas, analytics, configuration, export and import) are built.
| Risk | Source | Mitigation named in the sources |
|---|---|---|
| No global snapshot: a cross-group read can see a partially committed distributed transaction | ADR 0009 | Documented; single-group transactions are fully correct; a test documents the anomaly; phase 8 (in design, not built) |
| Map group as single point of failure and DDL bottleneck | architecture.md risks | Synchronous standby, map copied to every node, failover and switchover of the map group |
| A server that takes over a failed neighbour runs two primaries and carries the load of both | architecture.md risks | Capacity headroom; "restore preferred primaries"; alerts |
| The ledger detects but does not prevent |
kingres_ledger README, architecture.md |
External anchoring, publication; ledger_status lists roles that can drop a database |
| Rebase cost on each new PostgreSQL major | architecture.md risks, ADR 0001, ADR 0023 | Thin fork, a small register of core patches, one source with a compat header; the most exposed parts are the planner integration of kingres_shard and kingres_columnar. Measured in section 4 |
| Maintenance burden of features on sharding | architecture.md risks | Tests of each feature on a cluster; one line of work at a time on contrib/kingres_shard because parallel changes have conflicted before |
| Setup wizard of an uninitialised node claimed by someone on the network | architecture.md risks | One-time setup token, loopback only until used; the container image accepts remote setup, guarded by the token only, so publish its ports on 127.0.0.1
|
| A compromised member of the cluster | control plane README | Stated trust model: every server of a cluster is fully trusted by every other |
| A user database that plants objects in the schema of an extension | Security Model | The extensions and extguard check the schema before a superuser reads or calls anything in it |
| Trademark | architecture.md | The name KingresDB; "derived from PostgreSQL" notice; legal review open |
| Licence | ADR 0004, ADR 0024 | No Citus code; own code AGPL-3.0-only |
| Time between a committed ledger transaction and a published digest |
kingres_ledger README |
Block interval plus digest interval; anchoring shortens it |
The objection. A database that forks PostgreSQL has to carry upstream's work itself for as long as it lives: security patches, bug fixes, changes to the planner and the executor, to the WAL and to replication, compatibility with extensions, and every major upgrade. It then maintains a database engine besides its product, and that cost grows every year.
The answer in short. The objection is true of a deep fork, and the history in architecture.md shows it (Postgres-XL, Greenplum). It does not describe KingresDB as built: no file of PostgreSQL's engine is changed. A cost of following upstream remains, and it is of another kind: keeping the extensions working on every new major, and publishing a release after every upstream release. This section measures the first and lists the second, so that both can be checked again later.
The numbers below were measured on 2026-11-29 on kingres-18 at 783247e113 and kingres-19 at 6c79fa27f5.
kingres-18 against REL_18_7
|
kingres-19 against REL_19_0
|
|
|---|---|---|
Upstream files changed, outside kingres/ and contrib/kingres_*
|
7 | 4 |
| Of these, the core-patch register (KP-0001 to KP-0004) |
meson.build, contrib/meson.build, README.md, LICENSE (a new file) |
the same four |
| Of these, other files |
.github/CODE_OF_CONDUCT.md, .github/CONTRIBUTING.md, .github/SECURITY.md
|
none |
Files changed under src/ (the server, the planner, the executor, the WAL, replication) |
0 | 0 |
KingresDB's own code is in its own directories: about 74,000 lines of C in the five extensions under contrib/kingres_*, and the control plane, the console and the verifier under kingres/. The four registered patches are the product version string, the line that adds the extensions to the build, a section of the top-level README and the licence text (Branching and Synchronisation).
The measurement can be repeated in a clone that has the PostgreSQL repository as the remote upstream with its tags (upstream tags are not pushed to the project repository):
git diff --stat REL_18_7 kingres-18 -- . ':(exclude)kingres' ':(exclude)contrib/kingres_*'
git diff --stat REL_19_0 kingres-19 -- . ':(exclude)kingres' ':(exclude)contrib/kingres_*'
| Item of the objection | Does it apply? | Why |
|---|---|---|
| Security patches and bug fixes | Not as merge work | They arrive with the rebase onto the next upstream minor tag. Only the four registered files can conflict. What remains is the duty to publish (4.3, point 5) |
| Planner and executor changes | Not in the core; yes as extension compatibility | No planner or executor file is changed. The extensions attach through PostgreSQL's hooks (planner_hook, set_rel_pathlist_hook, set_join_pathlist_hook, create_upper_paths_hook, ExecutorStart_hook, ExecutorCheckPerms_hook, ProcessUtility_hook) and custom scans. A new major that changes a hook or a planner structure breaks the build or a test of the extension, not a merge |
| WAL changes | Not in the core; yes for kingres_columnar
|
kingres_columnar is a table access method with its own WAL resource manager (the registered id 255). It depends on those two interfaces staying as they are |
| Replication changes | Not in the core; yes as behaviour | Bucket moves use logical replication and standbys use physical replication, both unmodified. A change of upstream behaviour shows in the extension: PostgreSQL 19 renamed a column of pg_stat_subscription_stats that a kingres_shard script read, and the script had to follow |
| Extension and driver compatibility | No | Every PostgreSQL version symbol is unchanged (PG_VERSION, PG_VERSION_NUM, PG_MAJORVERSION, server_version, pg_config --version); KP-0001 only appends (KingresDB <version>) to the long version string |
| PostgreSQL version upgrades | Yes, bounded | Done once, from 18 to 19: the core patches applied unchanged to REL_19_RC2 and to REL_19_0. The differences between the majors are in one header per extension, src/pg_compat.h: 351 lines with 16 version checks in kingres_shard, 110 with 2 in kingres_columnar, 102 with 3 in kingres_ledger, 28 with 1 in kingres_sketch. One source file outside these headers still has a version check |
- Dependence on PostgreSQL internals. The hooks, the custom scan interface, the table access method interface, custom WAL resource managers, transaction callbacks and background workers are public extension interfaces, but they are not frozen between majors. For phase 8 (in design, not built) upstream-sync.md already lists fifteen internals to check first on every minor and every major upgrade, each with the test that fails if it changed. This cost comes from the size of the extensions, not from the fork: the same extensions on an unmodified PostgreSQL would carry it too.
-
A new major every year. Each one costs a new section in each
pg_compat.hand a full test run on every supported major. architecture.md names this the main risk of the project. How long KingresDB maintains each major is not decided. -
The minor rebase has not been run yet.
REL_18_7andREL_19_0are the newest upstream tags of their majors on 2026-11-29, so the routine "rebasing onto a new minor release" of upstream-sync.md has never been needed. It is a recommendation until its first run; that run records its conflicts in the work log, and the count of conflicts is the measure of whether the thin fork holds. - No automated watch of upstream. There is no build service, by decision (Branching and Synchronisation). Somebody has to notice an upstream release and run the routine by hand.
-
The duty to publish. This is the one cost that comes from being a fork.
kingres_sharddoes not compile against stock PostgreSQL, by design (it needsKINGRES_VERSION), so a user of KingresDB runs KingresDB's builds and cannot take a fixed server from the PostgreSQL project or a distribution. After every upstream security release the project owes a rebase, the test runs, and a new package and image for both majors. The documents state no target for how soon after an upstream release that happens. -
A gap in the register. The three files under
.github/in the table of 4.1 exist upstream, are changed onkingres-18only, and have no row in core-patches.md, whose rule 4 asks for one. They are documentation and cannot break a build, but they can conflict in a rebase and they make the two product branches differ.
The objection becomes true on the day a patch changes a file under src/. Each such patch is carried through every minor rebase and every major, on two branches. The defences are the rules of the register (an extension first, one small commit per patch, a test that fails without it, a row in the same commit) and decisions that keep new work out of the core: phase 8 makes no core patch (ADR 0032), and ADR 0001 is the decision for a thin fork with extensions.
Three numbers show whether the risk is growing, and they should be read again at every rebase and every new major: the count of upstream files changed (4.1), the count of conflicts of a rebase (the work log), and the size of the pg_compat.h headers (4.2).
The objection. An enterprise customer asks whether every extension and every tool it runs on PostgreSQL works unchanged on KingresDB. The more of the core a fork changes, the larger the compatibility risk. Compared with PostgreSQL and Patroni, that is a serious disadvantage.
The answer in short. The conclusion is partly true and the reasoning is not. The core is unchanged (section 4: no file under src/), so the compatibility gaps do not come from a changed engine. They come from four other places: the build options of the packages, third-party extensions (pgvector and pgaudit are bundled since 0.2.0; pg_cron was withheld from 0.2.0; PostGIS and the others are not packaged), the rules of distributed tables, and tooling. The first two are packaging decisions and are planned as phase 16 and phase 15. The third is a property of sharding. The fourth is partly documented and partly not tested. For a customer who needs neither sharding nor the ledger, PostgreSQL with Patroni is the more compatible choice today.
| Area | State | Source |
|---|---|---|
| Wire protocol and drivers | Unchanged. Every PostgreSQL version symbol (PG_VERSION, PG_VERSION_NUM, PG_MAJORVERSION, server_version, pg_config --version) is unchanged; core patch KP-0001 only appends (KingresDB <version>) to the long version string |
core-patches.md |
| Contrib modules | The package is built with meson, which builds the contrib modules whose dependencies are on. pg_stat_statements is preloaded and created in every database made by kingresd. sepgsql is not built (SELinux support is off) and xml2 is built without XSLT; this was read from the build files, not from a package listing |
packaging/README.md, build.sh |
| Tables that are not distributed | Ordinary PostgreSQL tables on one server; nothing of sharding applies | limitations.md |
| Metrics |
/metrics in Prometheus format, for an external Prometheus (Monitoring and Alerts) |
ADR 0020 |
| Replication | Physical replication for standbys and logical replication for bucket moves, both unmodified | section 4.2 |
| Gap | What is true | Planned | Source |
|---|---|---|---|
| JIT, LDAP, GSSAPI, PAM, NLS | Built off in every package, for the reason "a run-time dependency and an attack surface that is not needed yet" (JIT: "a large LLVM runtime dependency") | Phase 16 | build.sh, limitations.md |
| PL/Python, PL/Perl, PL/Tcl | Not built; only PL/pgSQL | Phase 16 | the same |
| pgvector, pg_cron, pgaudit and other third-party extensions | pgvector 0.8.7 and pgaudit are bundled in the Debian package, the image and the RPM packages since 0.2.0 (phase 15). pg_cron was built and then withheld from 0.2.0; it is bundled again in 0.2.1 and switchable with two restarts (see Extensions); PostGIS and the other candidates are not packaged. Extensions that duplicate a KingresDB function (Citus, TimescaleDB, postgres_fdw, dblink, pg_repack, pg_ivm) are refused by decision | Phase 15 (done in 0.2.0 but for pg_cron, which is done in 0.2.1), then phase 16 | architecture.md, limitations.md |
| Building an extension against KingresDB | The packages carry no headers and no PGXS kit, and there is no kingres-dev package; building means building KingresDB from source |
Phase 16 | limitations.md, packaging/README.md |
| Client program names | The client programs carry the prefix kingres- (kingres-pg_dump, kingres-pg_basebackup), so a script that calls pg_dump by name needs a change or a link |
Not planned | operator guide |
| Automated backup and point-in-time recovery | No automated backup and no archive configuration. Per-node pg_dump, pg_basebackup and coordinated restore points exist |
Not planned in a phase | operator guide, section 7 |
| pgBackRest, Barman, change data capture out of a cluster | Not tested and not documented. This page does not say that they fail | Not planned | none: the repository documents none of them |
| Patroni | Not used and not bundled, by decision: kingresd does the failover. A tool that expects the REST interface of Patroni does not apply |
Not planned | ADR 0021, limitations.md |
| Platforms | Debian package and image for Ubuntu 24.04, amd64; RPMs for the RHEL 9 and 10 families and Fedora 44 and 45 since 0.2.0; no arm64 | Not planned | limitations.md |
| Following upstream | The duty to publish a build after each upstream release | Not planned | section 4.3 |
These rules apply to tables that a user makes distributed or reference tables, not to ordinary tables. They are properties of sharding and not of the fork: any system that spreads one table over several servers needs rules of this kind. The sources are the README of kingres_shard and limitations.md (kingres_shard README, limitations.md).
- Row-level security, triggers, rules, inheritance and exclusion constraints are refused on a table that is made distributed or a reference table.
- Every unique constraint and every unique index must include the distribution column.
- A statement is shipped to the shard groups only when its functions, operators and aggregates are built in or belong to an extension on a list compiled into
kingres_shard(todaykingres_sketch). A function of a user is never shipped, and so are not the functions of a third-party extension. The statement is then answered by the distributed scan, which is correct and slower. -
UPDATE ... FROMandDELETE ... USINGthat read a distributed table and write another table are refused in 0.1.0 and 0.1.1 (from 0.2.0 they run on the groups), andMERGEruns only in the shapes the README lists. - There is no global snapshot: a statement that spans groups reads each group at its own snapshot. Phase 8 (in design) removes the fractured-read part of it when switched on.
-
Phase 16, build options of the released packages and extension packages (architecture.md, "Phase 16"). Planned on 2026-11-29, and now designed but not built: the owner decided D1 to D3 on 2026-11-29 (GSSAPI, LDAP, PAM, PL/Python, PL/Perl and JIT on; PL/Tcl and NLS only on request; authentication in the main package, languages and JIT as optional packages,
kingres-devseparate). It covers JIT, LDAP, GSSAPI, PAM, NLS and the procedural languages, each with the reason it is off, the cost, the package it would live in and the test that verifies it. Of what phase 15 leaves open, it covers extension packages for the RPM targets and akingres-devpackage. ADRs 0041 to 0043 are Accepted and 0044 to 0046 Proposed. - Phase 15, management of third-party extensions. Released in 0.2.0 with pgvector and pgaudit bundled; the first approved list was pgvector, pg_cron and pgaudit (pg_cron was withheld from 0.2.0 and is bundled again in 0.2.1), and PostGIS ships in a package of its own. A new candidate needs the owner's approval.
- Not planned: the rules of distributed tables (they stay as long as the data is sharded) and backup tooling.
- For a customer who needs neither sharding nor the ledger, PostgreSQL with Patroni is the more compatible choice today: more build options, any extension, any backup tool, no prefix on program names.
- For a customer who needs sharding or the ledger, the engine is unchanged PostgreSQL code. Drivers, SQL and the wire protocol work as before, and ordinary tables behave as before.
- Before a purchase the customer should list the extensions and tools it depends on and check each against 5.2. An extension that is not packaged cannot be installed from a package today, and a tool that is untested is untested, not known to fail.
- Authentication with LDAP, Kerberos or PAM, JIT, and Python or Perl functions are not available in the released packages. Phase 16 designs them (decided 2026-11-29) and has built none of it; no date is promised.
The objection. Sharding is a two-edged sword. It brings distributed transactions, joins and aggregation across shards, foreign keys, unique constraints, sequences, ordering, rebalancing, resharding, node replacement, network partitions, split brain and query routing. A simple query such as orders JOIN customers can turn into a slow cross-shard operation. A product that shards has to show real benchmarks, and single-table benchmarks are not enough.
The answer in short. Every item of the list has a defined behaviour in KingresDB, and those behaviours are tested for correctness against a single node. What is missing is measurement: the repository has no cluster benchmark. The only performance script is the one of the columnar storage. Phase 17 plans the benchmarks and the comparison with PostgreSQL and Patroni; it is planned for after release 0.3.0 and is not built.
| Item | What KingresDB does | Source |
|---|---|---|
| Distributed transactions | Two-phase commit across the groups, recovery of in-doubt transactions, detection of distributed deadlocks (the youngest transaction of a cycle is cancelled with 40P01). No global snapshot: a statement that spans groups reads each group at its own snapshot; SERIALIZABLE is per node. Phase 8 (in design, not built) removes the fractured-read part |
kingres_shard README, ADR 0009, limitations.md |
| Joins across shards | Four paths: a join of colocated tables on the distribution key and a join with a reference table, both computed in each group; the repartitioned join, which moves the rows of one table to the groups (routed by a column, or broadcast); and the complete scan, which answers every statement the others do not and is kept by decision | kingres_shard README ("The repartitioned join", "Join rows"), ADR 0022 |
| Aggregation and ordering | Closed queries, partial aggregation and sorted streams with a limit run in the groups; what does not fit these shapes is answered by the complete scan, with the same answer as a single node | kingres_shard README, CHANGELOG |
| Foreign keys | Allowed from a distributed table to a reference table, from a reference table to a reference table, and between colocated distributed tables on a key that holds the distribution column of both. Refused when created: a reference table to a distributed table, and a key between tables of different colocation groups | kingres_shard README, "Foreign keys that point at a reference table" |
| Unique constraints | Every unique constraint and unique index of a distributed table must include the distribution column; the error names the object | kingres_shard README |
| Sequences | Node-local. A row inserted from another node draws from that node's sequence. The state of a sequence is carried when a table is distributed, moved or undistributed | kingres_shard README |
| Rebalancing | Bucket moves with a copy, a catch-up and a switch; strategies, weights, an automatic mode; a bucket move is resolved after a failover. A rebalance is held back while a standby lags by more than maxStandbyLagBytes
|
limitations.md, kingres_shard README |
| Resharding | A bucket can be split (phase 10). A split is refused for a table without a primary key and for a colocation group with a columnar table, and cannot be undone | limitations.md |
| Node replacement | A drain moves the buckets and the distributed schemas of a server away and hands the map group over; servers and standbys are added and removed from the console and by REST | operator guide, limitations.md |
| Network partition and split brain | Leases granted by a majority, self-fencing and a catalog term; see section 9. Two failures at once are not tested on a cluster, and automatic failover is off by default | ADR 0021, limitations.md |
| Query routing | A router in kingresd picks the instance without parsing SQL; every server accepts writes, each bucket has one writer, and a multi-row INSERT is split by the row router in the extension |
ADR 0010, kingres_shard README |
Which path is taken depends on how the two tables were made. If both are distributed in one colocation group on the customer, and the join is on that column, each group joins its own rows and only the result crosses (join of colocated tables). If customers is a reference table, every group has a full copy and the join is local (join with a reference table). If the join is on a column that is not the distribution column of both, the planner may use the repartitioned join (in 0.2.0 it can ship up to three tables, also the preserved side of an outer join): routed when the column equals the distribution column of the other table, broadcast when it does not, chosen by cost (EXPLAIN shows a Repartition: line and, when it is not used, the reason). In every other case, and when kingres_shard.enable_repartition_join is off, the complete scan answers: correct, and slower because rows move. How much slower is not measured. That is the gap.
There is no cluster benchmark in the repository. The cluster tests compare the answers of a cluster with those of a single node and inject faults, so they show correctness and not throughput or latency. Phase 17 plans a benchmark harness, with one PostgreSQL server, PostgreSQL with Patroni, one KingresDB server and a KingresDB cluster as systems under test, and workloads named for what they measure (single-key access, a transactional mix in the shape of TPC-C, multi-group transactions, each join path, aggregation, bulk load, a rebalance under load, a failover, and scaling from one server to N). Phase 17 is scheduled after release 0.3.0, whose content the repository does not define.
The objection. A hash chain inside the database is not enough. Whoever controls the database can rewrite the chain. The root of trust must be outside the control of the database: WORM storage, an external timestamp, an external transparency log or a third-party witness.
The answer in short. The project does not claim tamper-proof. git grep -i "tamper-proof" over kingres and contrib/kingres_ledger on kingres-18 finds one quotation, in a research note. The README of kingres_ledger says that the ledger makes tampering detectable and not impossible, and that the digest stored outside the database is the root of trust. Anchoring to destinations outside the server is built. Four gaps remain; each has one place in the roadmap.
| The critique's anchor | What is built | Source |
|---|---|---|
| WORM storage | A WORM anchor target (an S3-compatible store with object lock) | ledger-phase7.md, operator guide |
| External timestamp | RFC 3161 and OpenTimestamps targets, with evidence that the verifier checks offline | ledger-phase7.md, verifier README |
| External transparency log | The ledger is published as a tile log with signed checkpoints (the C2SP formats), served over HTTP and mirrored by a directory or a bucket without lock | ledger-phase7.md |
| Checking that does not trust the server | A standalone verifier built from the Go standard library only | verifier README, CHANGELOG |
| Third-party witness | Not built (gap 4 below) | phase8-multinode-ledger.md |
| Gap | Where |
|---|---|
| 1. Anchoring to RFC 3161 authorities and to OpenTimestamps was tested against local fakes only | Phase 18, task 2: a manual, recorded run against real authorities; the choice of authorities is an open decision |
2. The check anchors of a ledger verification and the scheduled audit of the publication are not built in release 0.2.0 (the server answers 422 unsupported_operation) |
Phase 18, task 1: done and released in 0.2.1 (2026-12-02; ADR 0059). The phase 7 design lists them in step 20; the status row of phase 7 said "done, except step 24" and has been corrected |
| 3. An external signer command is not built, so the signing key is on the server | Phase 7, step 24 (optional). Not copied into phase 18 |
| 4. A third-party witness | Phase 8, in design: witnesses, then a notary of checkpoints (ADR 0033). Not copied into phase 18 |
Sources: limitations.md, "The ledger"; README of the project, status rows 7 and 8; phase 18.
The objection. A ledger can prove that transactions A, B and C were not changed. It cannot answer whether a transaction X that should have been recorded ever entered the system. Comparable ledger products separate tamper evidence from a guarantee that every event was recorded, so KingresDB must say exactly what it guarantees.
The answer in short. The critique is right, and the project does not claim completeness of events. The README of kingres_ledger has a section "What the ledger guarantees, and what it does not". What the ledger proves is about what was committed to a ledger table. It says nothing about what never reached the database.
Guaranteed (kingres_ledger README):
| Guarantee | Source in the README |
|---|---|
Every row version committed to a ledger table is in the chain: an I entry for a version entered and a D entry for a version removed, and an inclusion proof can be made for it |
The introduction, "Hash format version 1" |
| For an updatable table: the rows it holds now are exactly the entered versions minus the removed ones (as multisets of row hashes), and every removed version is in the history table with the transaction that removed it | "What an updatable table guarantees, and what it does not" |
No SQL path writes a ledger table without capture: the capture triggers are ENABLE ALWAYS, so session_replication_role = replica does not skip them. The tests name the paths: ON CONFLICT DO UPDATE, MERGE, foreign-key actions, COPY, views, prepared transactions |
"How it works"; the test table (ledger_updatable) |
For roles that are not superusers: nobody but the extension writes a row of the chain tables, and such a role cannot stop the block builder or the capture for longer than kingres_ledger.lock_hold_limit (60 seconds by default), nor remove the ledger or the protection of a ledger table with a statement that runs in that database |
"Who can write the ledger tables", "What a role that is not a superuser can stop or remove" |
A later rewrite is detected, relative to a digest stored outside the database (ledger_verify_digest); ledger_verify alone cannot show it |
"What the ledger guarantees, and what it does not" |
Not guaranteed:
| Not guaranteed | Source in the README |
|---|---|
| That a transaction that should have been recorded reached the database at all. If the application did not send it, or it was refused or dropped before it committed, the ledger has nothing to show | Follows from the guarantees above: they speak only of committed row versions |
The window: a committed transaction is covered only once it is in a block and a digest of that block has left the database (the block interval, 10 seconds by default, plus the digest export interval). Until then a privileged attacker could alter its entries undetected. The digests in kingres.ledger_digest are inside the database and are not a root of trust |
"What the ledger guarantees, and what it does not" |
| Authorisation and meaning: the ledger records the role that ran the statement, not whether the change was allowed or what it meant | "What an updatable table guarantees, and what it does not" |
| A superuser, and whoever can change the files, stop the server or edit the catalogs, are outside both invariants | "What the protections cannot stop" |
DROP DATABASE from another database removes the ledger with the database; it is open to superusers, to the owner of the database and to roles with its privileges. Publication and anchoring are what make it visible |
"What a role that is not a superuser can stop or remove" |
What comes near the missing-event problem, without solving it.
- Client signatures (
kingres_ledger0.3): with the signature policyrequiredon a table, a transaction that leaves an entry without a client signature is refused at commit (KL010, raised atPRE_COMMITand atPRE_PREPARE). This proves who submitted an entry. It does not prove that nothing was left out (README, "Client signatures"). - A receipt for the submitter: the parts exist (an inclusion proof, a published signed checkpoint, the standalone verifier), so a client can fetch evidence after the commit and keep it. I found no function and no REST operation that hands a receipt to the client automatically for every transaction; it is not built.
What a customer can be told. KingresDB proves that what was recorded has not been changed and that none of it was removed. It does not prove that everything that should have been recorded was recorded. Closing that gap belongs to the application: gapless numbering of its own events, a signed receipt kept by the submitter, and reconciliation with the source system.
A privileged user cannot change history without detection only if anchoring to a destination outside the server is switched on and somebody outside the server checks it. Without that, no.
The objection. Patroni was built over years to solve one problem: PostgreSQL, leader election, a distributed configuration store and failover. KingresDB manages sharding, replication, a ledger and failover together, so the number of failure modes grows. When one of three nodes dies and failover runs, what happens to ledger consistency, replication consistency, shard ownership, pending transactions and sequences? That has to be proven by chaos testing, not only by unit tests.
The answer in short. The premise that only unit tests exist does not hold: failover is tested on real clusters with real standbys, with faults injected at named points. The conclusion is partly right. Those tests are deterministic and each covers one scenario. There is no chaos harness: no random or combined fault schedules over long runs, and no recorded history of client operations with a checker. The failover of KingresDB is new in its first release, and Patroni has years of production use. Phase 17 plans the chaos part.
The numbers were counted on kingres-18 on 2026-11-29.
| Suite | Count | What it covers |
|---|---|---|
kingres/control-plane/internal/clustertest (Go cluster tests with real instances and standbys) |
92 files; 26 of them by name on failover, leases, fencing, standbys and faults (failover_*_test.go, lease_test.go, fence_test.go, fencing_stall_test.go, ledgerkills_test.go, rebalance_failover_test.go, rebalance_faults_test.go, standby_test.go, faults.go and others) |
Hard failover after the kill of a server, switchover, the failover of the map group, the old primary returning, partitions, paused processes, a stepped clock, a bucket move during a failover, the kills of the ledger publication at every kind of write |
TAP tests of kingres_shard (contrib/kingres_shard/t) |
247 files; 22 of them on standbys, promotion, failover and switchover (for example 050_failover_twophase.pl, 054_failover_move.pl, 063_catalog_term.pl, 068_participant_failover.pl, 069_inflight_promotion.pl) |
The origin of a two-phase transaction stopped at every point of the protocol, with a synchronous and an asynchronous standby, a failover during a bucket move, the catalog term, promotion rules |
limitations.md also records repeated runs of the switchover cluster tests: 95 of 95 on PostgreSQL 19 and 93 of 95 on PostgreSQL 18, on an overloaded machine.
An integration test with a named fault point makes one fault happen at one chosen step and asserts the end state. A chaos test runs a workload while a schedule of faults, drawn at random and often combined, is applied over a long time, records what the clients saw, and checks the history against what the system promises. The first proves a scenario that somebody thought of. The second looks for the ones nobody did.
The fault hook of kingresd (fault.go) cuts calls between servers in both directions (Isolate), steps the clock (ClockOffsetMs), delays named steps, and Pause stops a process with SIGSTOP. Isolate cuts the calls of kingresd to its peers (peerclient) and from them (internalapi). From the code, it does not cut PostgreSQL replication or client connections; that is not tested as a network fault.
| Question | What KingresDB does | Source |
|---|---|---|
| Shard ownership | The bucket map points to a group, not to a server. A group has one primary at a time; two primaries are prevented by leases granted by a majority and by self-fencing. A promotion raises the catalog term, and an old map primary that comes back is superseded |
ADR 0021, ha-phase5.md, t/063_catalog_term.pl
|
| A pending transaction | A distributed transaction commits or aborts on every node, also across a failover of a group that has a synchronous standby. With an asynchronous standby it can be half committed, and the extension says so afterwards. The identifier of a prepared transaction names the origin group, so the new primary resolves what the old one started | kingres_shard README, "Prepared transactions across a failover" |
| Replication consistency | A failover cannot restore data that no standby had. The dry run gives a verdict per group (none, asyncOnly, possible, unknown) and a real request must accept a possible loss explicitly |
limitations.md, operator guide |
| Ledger consistency | The chain is written in the database, so it reaches the standby through the WAL. The tests of kingres_ledger cover a standby and a promotion (009_worker), and the cluster tests kill the leader at every kind of write of the publication. A published chain that ends shorter than what was published stops the publication and raises the critical alert ledgerChainDiverged
|
kingres_ledger README, control-plane README, ledgerkills_test.go
|
| Sequences | Not documented across a failover. The documents say that sequences are node-local, and that after a restore point the values handed out afterwards are handed out again. What a sequence does when a standby is promoted is not described and not tested here | kingres_shard README |
- Random and combined fault schedules over long runs.
- A recorded history of client operations and a checker. Until phase 8 there is no global snapshot, so such a checker would check the guarantees of ADR 0009 and not serializability across groups. Only the design of phase 8 plans a Jepsen-style harness, for atomic visibility, and it is not built.
- Faults at the network level: delay, loss, a single link, an asymmetric cut, and a cut of replication traffic.
- Two failures at once, and a failure during a whole rebalance (limitations.md). One case is tested: a failover, a switchover and a map group failover during one bucket move (
rebalance_failover_test.go,t/054_failover_move.pl). The sentence of limitations.md is therefore true of a rebalance as a whole and not of a single move. - Automatic failover is off by default, and limitations.md says that failover is new in the first release and that the operator should test the recovery procedure on their own cluster before relying on it.
Patroni has years of production use. The failover of KingresDB is code written for this project; ADR 0021 names this as the main cost: "the safety of failover now rests on code written for this project instead of on Patroni's years of production use". It is addressed by keeping the mechanism small, by partition and clock tests, and by shipping automatic failover disabled. Those tests exist and are deterministic. A customer who needs a proven failover for a single primary today can run PostgreSQL with Patroni; KingresDB is the choice when sharding or the ledger is needed.
Phase 17, part 3, builds one cluster chaos harness on the rig of the benchmarks: nemeses for kill, power off, partition, delay and loss, a full disk, a stepped clock and a suspended process, two failures at once, and failures during a rebalance, a bucket move, a map group switchover and a transfer; five checks (one primary per group, every two-phase transaction on all or none, no acknowledged write lost with a synchronous standby, the chain verifies against earlier digests, no duplicate sequence value); long recorded runs; and every failure found becomes a deterministic test. The harness of phase 8 runs on it. An open decision is the exit criterion for recommending automatic failover as on by default.
The objection. In a partition, node A is cut off from B and C. Who is the primary? If both sides think they are, A writes and B writes, and when the network returns there is a conflict. The product has to say exactly which consistency model it has: strong or eventual, quorum, Raft, synchronous or asynchronous replication. This matters for enterprise sales.
The answer in short. The case "both sides write and conflict afterwards" is designed not to happen. The model in one sentence: strongly consistent within a shard group with one writer, available on the majority side of a partition and not on the minority side, never eventually consistent, and atomic but without a global snapshot across groups. It is a quorum of leases and not Raft.
Each server runs the primary of one group and standbys of its neighbours. A is cut off from B and C. The defaults are lease-duration 10 s, lease-renew 2 s and lease-margin 3 s (control-plane README).
- A cannot renew the lease of its group with a majority of the servers (it counts itself only). The holder acts on a lease only until
lease-durationminuslease-marginafter the start of its last successful round, that is 7 s with the defaults. When that time has passed, itskingresdwrites the fence marker and stops the instance withpg_ctl stop -m immediate. Test:TestPartitionedPrimaryWithStandbyStopsBeforeANewHolderCouldBeGranted; alsoTestAPrimaryWithoutAMajorityOfGrantorsIsFencedAndComesBackByItselfand, for a pausedkingresd,TestPausedKingresdNeverActsOnALeaseItLost. - B and C are a majority. The standby of A's group is promoted only after a majority has seen the old lease expire and the safety margin has passed, and has granted the lease to the new holder. This order is what makes A stop before anyone else can write (ADR 0021).
- The minority side never promotes: a failover is refused without a majority (
TestFailoverRefusedWithoutAMajority, and the version 0.5 rule ofpromote_nodethat only a minority of groups reachable is refused,KS012). - When the network returns, A's old primary is not a second writer. Its instance is stopped and held by the fence marker until a successful round of leases removes the marker, and, when another server has become the primary of the group, the old primary is rebuilt as a standby. The design lists "the old primary returning and being rebuilt as a standby" among its tests (phase 5 design, test list), and the cluster tests are
TestOldPrimaryReturnsandTestOldPrimaryReturnsAndIsRebuiltByABaseBackup. A promotion also raises the catalog term, so an old map group primary that comes back finds itself superseded (t/063_catalog_term.pl).
If the group of A has no standby, nothing can be promoted in its place. The primary keeps running and raises the alert leaseLost (TestPartitionedPrimaryWithoutStandbyKeepsRunningAndRaisesLeaseLost). That group is not protected against a partition, because there is no second copy to protect.
| Question | Answer | Source |
|---|---|---|
| Strong or eventual | Strong within a group. Each bucket has one writer at a time; there is no multi-master with conflict resolution | ADR 0010 |
| Quorum | Leases granted by a majority of the cluster's servers, with self-fencing; a standby is promoted only after a majority has seen the old lease expire plus the margin | ADR 0021 |
| Raft | No. There is no replicated log and no consensus store. Safety depends on bounded differences of clock rate between servers and on kingresd being scheduled within the margin |
ADR 0021, "Consequences" |
| Synchronous or asynchronous | PostgreSQL physical streaming replication. The durability of a database decides whether a commit waits for a standby. With synchronous durability an acknowledged commit is on two servers. With asynchronous durability a failover can lose the last commits; the dry run says so and a real request must accept it | ha-phase5.md, limitations.md |
| Across shard groups | Atomic commit by two-phase commit; no global snapshot | ADR 0009 |
-
Clocks and scheduling. Lease timing depends on bounded differences in clock rate and on
kingresdrunning within the margin. The tests include paused processes and stepped clocks, one scenario at a time (ADR 0021). - At least three servers for automatic failover to survive the loss of one. With two, losing either leaves no majority, and the surviving primaries stop accepting writes when their leases expire (ADR 0021).
- A group without a standby has no failover and keeps running, with an alert, when cut off (section 9.1).
- Asynchronous durability can lose the last commits at a failover; the dry run announces it (operator guide).
-
A synchronous group goes on without its standby after a grace period (
standby-sync-grace, 30 s by default): commits are acknowledged by two servers while a standby streams and by one after the grace period, and an alert says so (control-plane README, ha-phase5.md). - No global snapshot across groups (ADR 0009); phase 8 is in design.
- Automatic failover is off by default, and two failures at once are not tested on a cluster (limitations.md).
- The safety of failover rests on code written for this project instead of on the years of production use of Patroni (ADR 0021, "Consequences"). Section 8 says what is tested and what is not.
The objection. Rebalancing is one of the hardest parts of a sharded database. Shard 2 is on node B, B is full, and shard 2 must go to node D. Is the service interrupted? Do writes continue? How much WAL does it use? How long does it take? What if node D dies in the middle? What if the network is cut in the middle? What happens to the ledger chain? Online rebalancing is where distributed database products really differ.
The answer in short. KingresDB moves one bucket at a time online with logical replication: readers are not interrupted, writers wait only during a short switch, and a failure before the switch undoes the move. All of this is tested for correctness, on real clusters as well, including failures at the phases of a move. What is not measured is cost: the repository has no benchmark of the WAL a move generates, of the disk it uses or of its effect on throughput, and its only timing is a test run. Phase 17 plans these measurements, after release 0.3.0. The administrator's view of the same function is on Rebalancing; this section is the question-by-question answer.
The unit of a move is one bucket of one colocation group: the partitions of every table of the group move together. Reference tables do not move. wal_level = logical is needed. The phases, recorded in kingres.bucket_move before the action they announce (kingres_shard README, "What a move does"):
-
preparing: the preconditions are checked on both nodes, the move is recorded and the bucket is set to
moving. Routing is unchanged. - copying: on the target, standalone tables that are attached to nothing, so a scan never sees a half-filled copy; on the source a publication and a logical slot; on the target a subscription with the initial copy.
-
catching_up: until every table is ready and the lag is within
kingres_shard.move_catchup_thresholdor a marker row has made the round trip. - switching: one two-phase transaction across the map group, the source and the target.
-
cleaning: the subscription, slot and publication are dropped at once; after
kingres_shard.move_cleanup_delaythe orphan tables of the source are dropped.
| Question | Answer | Source |
|---|---|---|
| Is the service interrupted? | Readers go on throughout. Only the switch blocks writers, and only for as long as an attempt lasts: "normally tens of milliseconds", bounded by kingres_shard.move_switch_timeout (10 s by default) |
kingres_shard README, "What a move blocks, and for how long" |
| Do writes continue? | Yes until the switch and again after it. During the switch the lock is wider than the bucket: writers of every bucket of those tables on the source node wait, because PostgreSQL's DETACH needs the parent table exclusively, and writers of those tables on the target wait too |
the same section |
| A long transaction? | The switch tries for its locks with NOWAIT and never queues for them. An attempt that cannot get them is abandoned and repeated after a pause (0.2 s doubling to 10 s). A long transaction delays the move and costs the application nothing. After kingres_shard.move_switch_attempts (20 by default) the move fails, names the sessions in the way, and the bucket goes back to active
|
the same section |
| What if node D (the target) dies in the middle? | Before the switch the move undoes itself (subscription, slot, publication and the standalone tables are dropped, the bucket is active on the source again) or stays in its phase until kingres.resume_bucket_moves(), which the recovery worker of the map group primary calls every kingres_shard.recovery_interval. During the switch the two-phase commit decides: it commits on all or on none, and a switching row after a crash is a switch that did not commit; resume waits 2 x node_timeout before it undoes it |
kingres_shard README, "When a move fails: what an operator does" |
| What if the network is cut in the middle? | For the move a cut network is a node it cannot reach; the README does not describe it as a case of its own. The same rules apply: undo, or wait for resume, or the decision of the two-phase commit. A cut network as a fault is not tested at the level of the network (section 8) | the same section; section 8 |
| What happens to the ledger chain? | A ledger table cannot be distributed or made a reference table (SQLSTATE KS016), so it never moves with a bucket. There is one chain per shard group and it stays where it is. A distributed schema that holds a ledger table is pinned and cannot move |
limitations.md, "The ledger" and "Sharding" |
| How much WAL is used? | Not measured. The logical slot on the source retains WAL until the target has consumed it, so the amount depends on the size of the bucket and on the write rate during the move. An undo always drops the slot, so a failed move does not leave a slot that retains WAL; a slot left behind is reported by check_cluster()
|
design/shard-phase4.md, kingres_shard README |
| How long does it take? | Not measured as a benchmark. The initial copy carries the whole bucket, so the duration grows with its size. The only timing is a test run in the phase 4 design: about 0.2 s per move in t/027_move_under_load.pl (three writers, four moves under load, one machine, an assertion build, every statement started as its own psql), about 1.6 s when one attempt ran into a lock cycle and gave up after the lock timeout, and the longest statement 1.0 s |
design/shard-phase4.md, "Other deviations" |
- The switch lock is wider than the bucket. Writers of every bucket of the tables of the colocation group on the source node wait during the switch, not only writers of the moving bucket.
- A long transaction delays a move. It does not block the application, but it can make a move fail after the attempts are used up. The failed move can be started again.
- The unit is the colocation group. One move carries the partitions of every table of the group, so a large group moves a large bucket.
-
A rebalance run makes one move at a time. The extension allows moves of different buckets at the same time, but the control plane runs one move at a time and
maxConcurrentMovesdoes not change that. A failed move is tried again after a pause, up to three tries; a bucket given up ends the run as failed with a report and an alert. A move skipped because a group lost its lease or a required synchronous standby is not in sync is in the report and is not a failure (operator guide, Rebalancing). -
Resharding is limited. The bucket count is chosen when a table is distributed and can be changed with
kingres.alter_distributed_table, which rebuilds the table (blocking, or concurrently with the_concurrentlyvariant). A split of a bucket is refused for a table without a primary key and for a colocation group with a columnar table, and cannot be undone (limitations.md). -
A rebalance is held back while a standby lags by more than
maxStandbyLagBytes, and a drain moves the distributed schemas of the server with its buckets.
Test results here are from the documents; none were run for this page.
- The TAP tests of
kingres_shardcover a move under load (027_move_under_load), faults at every phase (028_move_faults), a failover in the copy, the catch-up and the switch (054_failover_move), a move against a scan (026,031,032), a held table synchronisation (074_move_tablesync_hold,083_move_subscription_sync), concurrent moves (202_concurrent_moves), the start lock (282_move_start_lock) and moves of columnar tables, partitioned tables and schemas. - The cluster tests of the control plane have a move killed during the copy, a server that goes down during the copy, the catch-up and the switch, and a manager whose task another holder takes over (
rebalance_faults_test.go), and a failover, a switchover and a map group failover during a bucket move (rebalance_failover_test.go). - What is not tested on a cluster: two failures at once, and a failure during a whole rebalance as opposed to one move (limitations.md says "a failure during a rebalance"; the tests above cover one move, so the sentence is true of a whole run only). Phase 17 plans the faults at each of the five phases of a move.
Phase 17, part 1, task 3a (after release 0.3.0, not built): for a move and for a whole rebalance run, at several bucket sizes and write rates, the duration of each phase; the WAL generated and the WAL retained by the slot, and the peak disk use on the source and the target; the time writers wait at the switch as a distribution, and how often an attempt is abandoned; the effect on throughput and latency percentiles during the copy, the catch-up and the switch; the same with several moves at once; and the cost of a move that is cancelled or fails.
The objection. Columnar storage is a feature, not an absolute advantage, and it must be clear why it is there. If the aim is OLTP and OLAP together, the product has to show that a hybrid workload really got better: for example 10,000 writes per second while SELECT SUM(...) GROUP BY ... runs, and how much columnar helps. Otherwise the product turns into "we have every feature", which is dangerous for a product.
The answer in short. The reason is stated and narrow, and the project does not claim OLTP and OLAP on one table. The conclusion of the critique is right on one point: no measurement of columnar storage is recorded in the repository, and the hybrid scenario was never run. Phase 17 plans it, after release 0.3.0.
The README of kingres_columnar says that a columnar table "is meant for append-only analytic data: time series, events, logs, and old partitions of such data" (README). It is not meant for a table that is updated, deleted from or locked by rows. A search of kingres/, contrib/kingres_columnar and contrib/kingres_timepart on kingres-18 finds no claim of HTAP or of a hybrid speed-up; the word "hybrid" appears only for the hybrid logical clock of phase 8.
Not one table for both loads, but two kinds of partitions of one table. A time-partitioned table (kingres_timepart) keeps the recent partitions in row storage, where the writes go. A policy converts old partitions to columnar storage after a set time (columnar_after). A conversion builds a columnar copy and swaps it for the original in one transaction with short, bounded locks and retries; writers of that partition wait during the copy (analytics-phase12-storage.md, goals and decision D8; Analytics Extensions).
The README names three sources: column projection (a query that reads a few columns of a wide table reads only those), skipping stripes and chunk groups by the stored minimum and maximum, and compression (codecs none, pglz, lz4, zstd). There is no vectorised execution (README, limitations.md), so the gain is in reading less and not in computing faster. For an aggregate over data that is already in memory the gain may be small. That is a hypothesis; it is not measured. Where columnar is expected to lose (a point lookup by key, a read of all columns, small tables) is also not measured.
| Limit | Source |
|---|---|
UPDATE, DELETE, row locks and foreign keys are refused; so are temporary and unlogged tables and indexes other than B-tree |
README, "What is refused, and why" |
| No TOAST; no vectorised execution; logical decoding covers inserts only; scans are serial or parallel | limitations.md, "Columnar storage, sketches and time partitioning" |
| Writers of a partition wait while it is converted | analytics-phase12-storage.md, D8 |
| A split of a bucket is refused for a colocation group with a columnar table | limitations.md |
| A ledger table cannot be columnar | limitations.md, "The ledger" |
-
contrib/kingres_columnar/perf/perf.sh(withshapes.sql) measures size on disk and scan time against heap on four data shapes (a time series of 20 columns, a wide table of 100 columns, random text, highly repetitive data), on a throwaway server. It asserts nothing, it runs on an idle server with no concurrent writes, and it reads the columnar table with a serial scan only. Its header comment said that the columnar table has no parallel scan; that was stale (the README has a parallel scan) and is corrected in the repository. - No result of a run was found in the work log, the review reports, the design documents or the changelog. The only numbers about columnar tables in the reviews are about the memory of a stress case (for example a backend of 378 MB against 21 MB for a heap table in a test with 30,000 blocks, in the review of 0.1); they are not a measure of size or speed.
- No hybrid test exists. The scenario of the critique is not measured.
Phase 12 added three extensions: kingres_columnar, kingres_sketch and kingres_timepart. None has a published measurement. The defence that exists today is that the claims are written narrowly and each README says what is refused and why. What is missing is numbers.
Phase 17, task 3b (after release 0.3.0, not built):
- a hybrid workload on a time-partitioned table, with writes at a fixed rate into the recent partitions and analytic queries on the old partitions, run with the old partitions in row storage and in columnar storage, on one server and on a cluster, reporting the write throughput and latency with and without the analytic load and the analytic query times with and without the write load;
- columnar against row storage in isolation, with results recorded: size per codec, narrow and wide projections, selective and unselective filters, cold and warm cache, serial and parallel, and the cases where columnar is expected to lose;
- the cost of the conversion of a partition: time, WAL, the wait of writers, the disk used during the copy;
- the same for
kingres_sketch(accuracy and speed against exact aggregates, on one server and pushed to the groups) andkingres_timepart(the cost of a policy run); - a rule for the result: where the measurement shows no gain for a stated use, the documents say so, and a feature keeps its place by a measured use. What happens to a feature without a measured use is an open decision of the owner (B5).
The objection. Upgrading can be painful: KingresDB 1.x to 2.x, changes in upstream PostgreSQL, changes in the extensions, migration. If the fork is deep, an upgrade becomes a project of its own.
The answer in short. The reason does not apply: the fork is not deep (section 4), so an upgrade does not carry a patched engine. The conclusion does apply, for other reasons that the upgrade guide states itself: there is no move between PostgreSQL majors, there is no rollback, the extensions are updated by hand, a cluster with servers of two versions has a window in which distributed statements fail, and the procedure for a whole cluster is a recommendation and not a tested procedure. Phase 19 plans an upgrade of the whole cluster from the console, to ship with release 0.3.0; it is not built.
| Pain | What is true | Source |
|---|---|---|
| A major version | No move between PostgreSQL majors (18 to 19 or back). The package preinst refuses the other major or a data directory of the other major. The way is a new cluster and a move of the data. That procedure is not designed |
upgrade.md, ADR 0023 |
| No rollback | No downgrade and no rollback of a package upgrade or of ALTER EXTENSION ... UPDATE. The way back is a restore from a backup |
upgrade.md |
| The extensions by hand |
ALTER EXTENSION ... UPDATE in each database, on every server, as a superuser. Only the ledger has a console task (ledger.upgrade, POST /api/v1/databases/{db}/ledger/upgrade) |
upgrade.md |
| The mixed-version window | From the restart of the first server with the new library until every server has run the update, distributed scans and fan-out writes fail; single-key reads and writes keep working. The settings kingres_shard.enable_pushdown, enable_bulk_routing and enable_copy_routing must be switched off by hand while the cluster is mixed. The block builder of the ledger does not run until its update |
upgrade.md |
| A pause of writes per group | A package upgrade restarts the service and the database of that server. No planned switchover and no restore of preferred primaries may run while servers of two versions run (the alert versionMismatch), so each group has a short pause of writes. How long is not measured |
upgrade.md |
| A package is installed by hand | Each server gets its package by an administrator, one at a time. There is no apt or dnf repository, and the packages are not signed (the checksums file is, since 0.1.1) | limitations.md |
One ALTER EXTENSION kingres_shard UPDATE takes any earlier version to the current one, and a regression test compares the result with a fresh install. kingresd migrates the system database by itself, at every start. The REST contract is additive between revisions, so an older client keeps working. Tasks and the failover journal survive the restart of an upgrade (upgrade.md). The core is not patched, so a new upstream minor is a rebase of four registered files (section 4).
A package upgrade is tested for a revision bump of the same version (+pg18-1 to +pg18-2). Upgrades between different KingresDB versions are exercised by the extension tests and the cluster tests, not by the package tests. The order for a whole cluster, servers that hold only standbys first and the manager leader last, is "a recommendation and not a tested procedure" (upgrade.md, Upgrades). The first release, 0.1.0, was published on 2026-11-28, so no earlier release existed to upgrade from.
This paragraph describes general PostgreSQL practice and not a statement of this repository. With PostgreSQL and Patroni a minor upgrade is a rolling restart with a switchover of the primary, and a major upgrade is pg_upgrade, a known procedure with years of use. KingresDB has no procedure for a major upgrade, a pause of writes per group at each restart, and extension updates that are manual. For a customer who needs neither sharding nor the ledger, that makes PostgreSQL with Patroni the lower-effort choice for upgrades today.
Phase 19, "upgrade of a cluster from the console", is planned to ship with release 0.3.0 and to be built in parallel with other work (the content of 0.3.0 is not otherwise defined in the repository). Nothing of it is built. The project owner decided the following on 2026-11-29, and the decisions are recorded in ADR 0035, ADR 0036 and ADR 0037:
| Decided | What |
|---|---|
| The source | The package is taken from the GitHub releases of the project. GitHub is a transport that is not trusted: the sums file is verified with a release key that the installed product already trusts, then the checksum of each file, on every server |
| No automatic start | The console may check for a newer release, show it, and fetch and verify it. Nothing is installed until an administrator starts the upgrade |
| No outbound access | A cluster that cannot reach GitHub is upgraded by upload of the same signed files, in the console, by REST or with kingres-cli; from there the path is the same |
| The privilege | Installing a package needs root, and kingresd runs as the unprivileged user kingres. A small root-owned helper installs only a package whose checksum is in a sums file signed by a trusted release key, and accepts nothing else. An ADR was written first (0036); the detailed design and an independent review come before code |
| The pause of writes | Measured and documented first; a planned switchover between two versions is decided only after a test shows it safe |
| Rollback | The stop state (what works in a cluster that stopped in the middle) is defined and tested first. No rollback is promised in 0.3.0 |
| The release key | The cluster trusts a set of release keys. An ordinary rotation needs no action, because a release ships the next key. An administrator can add a key, in the console, by REST and with kingres-cli, after checking its fingerprint against the one the project publishes; every change is in the audit log. A key that carries an endorsement signed by a trusted key is shown as endorsed. The helper reads its key set from a root-owned place, so that a compromised kingresd cannot add a key and become root. A key that is not endorsed needs a local root step on each server |
A key that is not endorsed does not take effect from the console alone (decided by the owner on 2026-11-29): it is recorded as pending and needs a local step run as root on each server, which shows the fingerprint, asks for confirmation, installs the key into the root-owned key set of that server and writes an audit record that the console shows. Otherwise an administrator session would be equivalent to root on every server. An endorsed key is added from the console and takes effect through the helper without a local step. Phase 19 has no open decision of the owner left. The release public key is today published in the verifier README and on The Verifier and is not shipped in the installed product; the package would ship it.
Also planned: a check of the checksum and the signature on every server, a preflight that the administrator confirms, one durable task that upgrades the servers in a set order and then runs the extension updates and the ledger upgrade with the routing settings off during the mixed window, a console page, kingres-cli commands, and cluster tests with a fault at every step. A container deployment is not upgraded by the console: the image is on Docker Hub, and the console reports the installed version. A move between PostgreSQL majors and a package downgrade are not promised.
- Phase 15 (management of third-party extensions) is designed and comes after the first release; extensions that duplicate a function of KingresDB are refused.
- Moving a cluster between PostgreSQL majors is not designed (ADR 0023).
- Phase 8 (atomic visibility of distributed transactions, and a multi-node ledger with witnesses and a BFT notary of checkpoints) is in design since 2026-11-28 and not built; no core patch of PostgreSQL is made (ADR 0032), it is off by default once built, and the limits above hold until it is released.
- The "Open questions" sections of the design documents (kingres/docs/design) list the rest per phase.
- Long documents: the extension and control plane READMEs are very long; some sections of the control plane README keep the wording of the increment in which they were written (the README says so, and its table "What is implemented" is current). A reader needs the wiki pages to navigate them.
- No automated build service by decision: checks depend on discipline and local runs.
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/guide/limitations.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/CHANGELOG.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/architecture.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/control-plane/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/packaging/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/worklog.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/adr/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/dev/core-patches.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/dev/upstream-sync.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/contrib/kingres_shard/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/packaging/build/build.sh
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/guide/operator-guide.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/guide/upgrade.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/adr/0035-a-cluster-upgrade-takes-its-package-from-github-releases-or-an-upload-and-starts-only-at-an-administrators-request.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/adr/0036-a-root-owned-helper-installs-only-packages-signed-by-a-trusted-release-key.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/adr/0037-the-cluster-trusts-a-set-of-release-keys-rotated-in-the-standard-way-and-added-by-an-administrator.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/design/shard-phase4.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/design/ha-phase5.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/design/ledger-phase7.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/design/analytics-phase12-storage.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/docs/adr/0021-failover-in-kingresd.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/contrib/kingres_ledger/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/contrib/kingres_columnar/README.md
- https://github.com/KingresDB/Kingres/blob/kingres-18/kingres/verifier/README.md
KingresDB's own code is licensed under AGPL-3.0-only. PostgreSQL code keeps the PostgreSQL License. Copyright of the project's own code: RooyeKhat Media Co. KingresDB is derived from PostgreSQL and is not endorsed by the PostgreSQL project. Repository | Licence | COPYRIGHT
KingresDB
1. Product
- Product Overview and Features
- Status and Roadmap
- User Guide
- Administrator Guide
- REST API Reference
- Web Console
- Command Line Client
- Extensions
- Limitations and Known Issues
- Release Notes
Features in detail
- Sharding
- Sharding Query Pushdown
- Sharding Table Lifecycle
- High Availability
- Ledger
- Ledger Signing and Publication
- Ledger Anchoring
- The Verifier
- Analytics Extensions
Administration
- Cluster Setup
- Servers Databases and Roles
- Rebalancing
- Configuration
- Memory and Warm-up
- Control Plane and REST API
- Upgrades
2. Architecture (arc42)
- Architecture
- Architecture Introduction and Goals
- Architecture Constraints
- Architecture System Context
- Architecture Containers
- Architecture Components
- Architecture Runtime Views Sharding
- Architecture Runtime Views Availability and Ledger
- Architecture Deployment
- Architecture Crosscutting Concepts
- Security Model
- Architecture Decisions
- Architecture Quality Requirements
- Architecture Risks and Technical Debt
- Enterprise Architecture
3. Data architecture
- Data Architecture
- Data Model Sharding
- Data Model Ledger
- Data Model System Database
- Data Model Analytics
- Data Lifecycle
- Backup Restore and PITR
- Data Security
- Data Quality and Integrity
4. Development
- Building from Source
- Development and Testing
- Repository Layout
- Coding Standards
- Branching and Synchronisation
- Testing Strategy
- Review Process
- Release Process
- Contributing
5. Operations