Repository navigation
Architecture Constraints
Mohammad Rasoul Kazemi edited this page Nov 30, 2026
·
8 revisions
Chapter 2 of the arc42 structure (Architecture). Constraints are things the design must live with; each row names its source.
| Constraint | Detail | Source |
|---|---|---|
| Thin fork | Core patches only where an extension cannot do the job; each patch has an ID KP-NNNN, a register row and a test. The register has four entries: the product version in meson.build, the KingresDB section of the top-level README.md, the extension list in contrib/meson.build and the LICENSE file |
ADR 0001, core-patches.md |
| Two PostgreSQL majors from one source |
kingres-18 on REL_18_7, kingres-19 on REL_19_0 (PostgreSQL 19.0). The KingresDB directories are byte for byte equal on both branches; version differences live in a compatibility header (pg_compat.h) |
ADR 0002, ADR 0023, releases.md |
| One major per cluster | All servers of a cluster run one major, one package name with the major in the version; moving a cluster between majors is not designed | releases.md, packaging README |
| Meson only | The autoconf files are left as upstream ships them; a KingresDB build uses meson | core-patches.md |
| Sharding as an extension | The planner and executor are reached through hooks and custom scans, not by changing the executor | ADR 0001, architecture.md |
| No global snapshot | Two-phase commit with Read Committed per shard; a statement spanning groups reads each group at its own snapshot. Phase 8 (in design, not built) would add atomic visibility for covered read-only statements, off by default; it would not be a global snapshot | ADR 0009 |
| Fixed bucket count | Fixed hash buckets per colocation group (1 to 4096, chosen when a table is distributed; the implemented default is 128, see the note in the ADR; kingres.alter_distributed_table can change the bucket count by rebuilding the table in one transaction while writers wait); a bucket can be split (phase 10), which cannot be undone |
ADR 0007 |
| The complete scan is permanent | Every faster path is an addition, never a replacement | ADR 0022 |
| Control plane stack | Go backend, Vue 3 and TypeScript frontend, OpenAPI contract first | ADR 0016, ADR 0017 |
| Failover without Patroni or etcd | Leases granted by a majority of the servers, inside kingresd
|
ADR 0021 |
| No bundled metrics store | A short in-memory history and a /metrics endpoint for an external Prometheus |
ADR 0020 |
| Target platform | Ubuntu 24.04, amd64: a Debian package (.deb) and a container image per major (0.1.0 and 0.1.1), and since 0.2.0 also an RPM per major for the RHEL 9 and 10 families and Fedora 44 and 45 (AlmaLinux 9 and 10 and Fedora tested); no arm64, no Windows server package; the packages themselves are not signed and there is no apt or dnf repository (the checksums are signed since 0.1.1) |
packaging README, ADR 0014 |
| Build environment | C code is built and tested in WSL2 (Ubuntu 24.04) on the developer machine; Go and Node.js build natively | ADR 0005 |
| Preload list |
kingresd sets shared_preload_libraries = 'kingres_shard,kingres_ledger,kingres_columnar,pg_stat_statements' on every instance; kingres_columnar and pg_stat_statements are left out when their library is absent. kingres_columnar registers a WAL resource manager (id 255, registered on the PostgreSQL wiki list), so a columnar write needs the preload, which takes effect at a restart: restart the standbys of a group before its primary |
packaging README |
| Constraint | Detail | Source |
|---|---|---|
| Licence | KingresDB's own code is AGPL-3.0-only; PostgreSQL's code keeps the PostgreSQL License; no Citus code is copied. New files carry the AGPL header | ADR 0024, ADR 0004, COPYRIGHT |
| Trademark | The name must not contain PostgreSQL marks; the repository states that KingresDB is not PostgreSQL and is not endorsed by the PostgreSQL project | architecture.md, root README |
| Tags only for releases | The first release, 0.1.0, was published on 2026-11-28 with the tags kingres-0.1.0-pg18 and kingres-0.1.0-pg19. It contains every phase except phase 8 (all built) and phase 15 comes after it; tags exist only for releases |
architecture.md, releases.md |
| No continuous integration | No CI workflow of this project exists, runs or is published on GitHub, by decision of the project owner; every check runs on a developer's machine. ADR 0005 and the research mention a CI job as a plan; that plan is not followed | packaging README, ADR 0005 |
| Independent review | Built parts are reviewed by independent reviews whose reports are kept; findings are fixed with a test that fails without the fix | kingres/README.md, Review Process |
One line of work on kingres_shard at a time |
Parallel changes to contrib/kingres_shard have conflicted before |
architecture.md, "Phases 9 to 12" |
| Branch rules | Development on kingres-18; kingres-19 receives sync commits and is not rebased by a sync; tags only for releases |
releases.md, Branching and Synchronisation |
English only in code, comments, documents and messages; an SPDX header in every own file; tests that fail without the fix. See Coding Standards.
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