跪拜 Guibai
← All articles
Frontend

KingbaseES's Single Kernel Powers Seven Deployment Shapes: From Single Node to Distributed Clusters

By 笃行_其道 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Scaling from a single node to a distributed cluster becomes a module addition, not a migration, which removes a major cost barrier for teams growing a database. But the documented limits—no SSI, no async events, and a 200% response hit on conflicting operations—set clear boundaries for where that convenience stops.

Summary

KingbaseES's centralized family spans four shapes, each with its own RTO/RPO trade-offs: single-node has RTO over 10 minutes on node failure, ClusterWare primary-standby takes a minute-plus to switch, RWC read-write separation holds RTO under a minute, and RAC shared-storage multi-active also stays under a minute. All claim RPO 0 and no application rewrites.

The RWC failover runs through seven rigid steps: reconnect confirmation, isolation, an election with hard criteria (log position, priority, node_id), majority check, network ping to trusted gateways, VIP/arping takeover, and a watchdog layer with repmgrd and kbha. The documentation even gives formulas for switchover time.

Distributed clusters come from stacking four modules on the same kernel: sharding management, distributed execution, distributed transactions, and global transaction consistency. That avoids the sharding-middleware route, keeping the SQL execution path identical. Costs hinge on storage, app migration, maintenance, and recovery time; the documentation also lists gaps like no SSI and no async notification, and warns that conflict-heavy workloads pay a 200% response penalty.

Takeaways
— Single-node: network/node failure RTO >10 min, storage failure >30 min, RPO 0.
— ClusterWare: two machines, one storage copy, switchover takes >1 min.
— RWC: one primary, multiple replicas; write response ~120% of single-node, RTO <1 min, RPO 0; each node holds a full copy.
— RAC: shared storage, multiple instances; normal ops ~120%, conflicting ops ~200%, RTO <1 min, RPO 0; single storage copy with 2x redundancy.
— App migration cost is 'none' for all four centralized forms.
— RWC failover: seven steps—reconnect confirmation, isolation, election, majority check, network confirmation, VIP/arping takeover, watchdog.
— Election criteria: sync mode requirements, then log position, priority, node_id.
— Shortest switchover time formula: (reconnect_attempts-1)*reconnect_interval + 1 + ping time + VIP switch time.
— Distributed adds sharding management, distributed execution, distributed transactions, global transaction consistency.
— Distributed clusters: TDC, Sharding, ADC on the same kernel.
— Distributed route keeps SQL execution path unchanged; no external middleware for transactions/consistency.
— Key design tasks for distributed: shard key, cross-shard transaction splitting, global indexes.
— Decision questions: data >TB in 3 years, 10k concurrency, team with distributed management experience.
— Documentation gaps: no SSI, no async notification, 200% response on conflict-heavy ops.
Conclusions

The RWC election and failover process is fully deterministic, with three hard criteria and no human override, which makes switchover predictable but leaves no room for judgment in unusual network partitions.

KingbaseES's distributed design keeps transactions and global consistency as kernel modules rather than external middleware, so the execution path and tooling stay identical across centralized and distributed deployments; that's a meaningful divergence from the sharding-middleware approach.

The documentation's self-listed limitations—missing SSI, missing async notification, and a 200% response hit on conflicting operations—are concrete constraints that a team must weigh against the convenience of a single codebase.

Concepts & terms
ClusterWare
KingbaseES's primary-standby cluster mode: two machines each store a copy of the data, and the standby takes over when the primary fails; switchover takes more than a minute.
RWC (Read-Write Separation)
A cluster with one primary and multiple replicas; writes go to the primary, reads to replicas. Write response is about 120% of single-node, RTO under 1 minute, and each node holds a full copy.
RAC (Shared-Storage Multi-Active)
Multiple database instances share the same underlying storage, each can read and write. Normal ops are ~120% of single-node, but conflicting cross-node ops can hit ~200%.
SSI (Serializable Snapshot Isolation)
A concurrency control level that guarantees serializable execution; KingbaseES's current version does not support it, per the article.
repmgrd and kbha
repmgrd is the failover manager that runs the RWC switchover steps; kbha is a watchdog that checks repmgrd's pid file every 3 seconds and restarts it if needed, with kbha itself monitored by cron.
TDC, Sharding, ADC
Three distributed cluster types built on the same kernel by adding sharding management, distributed execution, distributed transactions, and global transaction consistency.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗