GaussDB High Availability Deployment: Components, Replication Modes & Huawei Cloud vs TPOPS Topologies
This article details GaussDB's primary-standby architecture components, WAL-based replication mechanisms (Quorum/Paxos), synchronous modes (max protection/availability/performance), cross-region streaming replication, and compares Huawei Cloud HCS-based vs lightweight TPOPS deployment topologies for intra-city and cross-region HA with RPO guarantees.
Reading font
1. GaussDB Database Components
1.1 Centralized Primary-Standby Cluster Core Components
The cluster consists of management components (CM) and data components (DN, ETCD).
CM Agent : Launched by OMM every 1 second. Responsible for CMS/DN process keep-alive and start/stop, arbitration metric collection, and arbitration command execution. Runs on every host. Failure loses start/stop capability and instance fault detection.
CM Server : Launched by CM Agent every 1 second. Judges instance health from CM Agent reports, decides if repair is needed, and issues commands to CM Agent. Persists cluster topology in ETCD.
OM Monitor : Launched by crontab every 1 minute. Keeps OMM, etcd, and cm_agent processes alive.
DN Node : Data service component, launched by CM Agent every 1 second. Stores business data, executes queries, returns results. Primary-standby replication uses Quorum or Paxos protocol.
ETCD Node : Management component, auto-launched by OMM every 1 second. Assists CMS leader election, persists arbitration info, stores cluster topology.
1.2 Region and Availability Zone
Region : Physically independent data center. Resources cannot change region after creation. Provides maximum fault isolation.
Availability Zone (AZ) : Within a region, power and network isolated physical areas (e.g., two data centers). AZ failure does not affect other AZs. Multiple AZs per region, physically isolated but internal network interconnected for low-latency, low-cost connectivity.
Region mapping relates to multi-center HA architecture: production/city/DR sites as separate regions, or production+city as one region and DR as another. RPO requirements differ across regions.
1.3 Primary-Standby Data Synchronization Mechanisms
1.3.1 WAL Log Mechanism
GaussDB uses Redo (WAL) for crash recovery and replication. Core principle: log modifications before data file changes . Transaction records go to in-memory RedoLogBuffer; when full or no more records, they are handed to RedoLogHandler and written to XLog (WAL). This avoids flushing data pages on every commit; crashes are recovered via log REDO.
WAL enables: crash recovery via xlog, primary-standby sync via log shipping, PITR backup restore. Difference from MySQL binlog: WAL records physical page modifications ensuring logs persist before data files; binlog records logical changes (SQL statements). GaussDB can convert xlog to binlog-like format via logical replication.
1.3.2 Intra-Region Primary-Standby Replication
In 1-primary-multiple-standby, primary uses WalSender threads to send logs; each standby uses a WalReceiver thread to receive, flush to local disk, and replay redo logs. WalWriter persists in-memory logs to durable storage.
WAL (Write-Ahead Logging) : Standard transaction logging; log must persist before data file changes.
WAL Receiver : Standby thread receiving data/commands from primary, sending acknowledgments. One per standby.
WAL Sender : Primary thread per standby connection, sending data/commands, receiving info. Multiple per primary.
WAL Writer : Background thread writing redo logs from memory to disk.
REDO Log : Contains info to redo operations; used for crash recovery.
GaussDB uses Quorum or Paxos consistency replication within a region. Commit requires majority (over half) acknowledgment , so log nodes are deployed in odd numbers.
Three synchronous modes based on business availability needs:
Maximum Protection : Transaction commits only after xlog persisted on majority standbys. Guarantees RPO=0 . Parameter: synchronous_commit=on. If network issues or majority standbys fail, primary cannot commit.
Maximum Availability : Auto-fallback from Maximum Protection when standbys unavailable, allowing primary to continue. Cannot guarantee RPO=0 . Parameter: most_avaiable_sync=on.
Maximum Performance : Transaction commits after local xlog flush. Primary performance unaffected by standbys. Possible data loss on primary failure . Parameter: synchronous_commit=off.
1.3.3 Cross-Region Streaming Replication
Cross-region sync uses streaming replication based on WAL logs. Typically two separate clusters (production and DR) with log replication relationship. Cannot guarantee RPO=0 .
Controlled by max_replication_slots (log replication slots) and max_keep_log_seg (logical log segments) to limit replication rate and prevent standby log pile-up affecting performance.
2. Huawei Cloud GaussDB High Availability Deployment
Two deployment modes: Huawei Cloud HCS foundation (leverages existing IaaS ops capabilities, reduces duplicate build) and Lightweight TPOPS platform (independent of Huawei Cloud foundation, manages GaussDB instances via TPOPS). Article focuses on centralized architecture.
2.1 HCS Foundation-Based HA Deployment
Combines intra-city and cross-region multi-AZ deployments. Typical scenarios:
1) Production Intra-City Single Region Deployment
Left: Single-center 1AZ 3-replica . For scenarios not requiring site-level DR but needing intra-center HA. DN primary-standby uses streaming replication, sync to at least one standby → RPO=0 . Standby failure: no business interruption. Primary failure: auto failover.
Right: Intra-city 3AZ 4-replica active-active . Two business AZs + one arbitration AZ. Any AZ failure guarantees RPO=0 . AZ1/AZ2 peer deployment; AZ3 arbitration only (no business). AZ3 ensures ETCD majority survival during single AZ failure. DN streaming replication with cross-AZ sync standby → no data loss. Standby failure: no interruption. Primary failure: auto failover. AZ1/AZ2 support manual switchover.
2) Production Intra-City Cross-Region Deployment (Guarantee Intra-City RPO=0)
Different regions = separate clusters; inter-cluster uses streaming replication (no RPO=0). To achieve RPO=0 across regions on HCS, must use storage replication . GaussDB + Dorado storage implements compute-storage separation and storage-level HA. Two regions each have full database cluster with complete data; intra-cluster primary-standby uses shared volumes → RPO=0 . Cross-region DR requires manual switchover. Flash storage must support remote replication LUN, NAS filesystem, and IP network connectivity .
If intra-city RPO=0 not required, dual-region deployment with database cross-region streaming replication is used. Sometimes chosen due to bandwidth/latency constraints: strong sync impacts performance. However, most scenarios have ~0.5ms latency between production and city sites, meeting business latency needs .
DR sites have higher latency due to distance → separate region, no RPO=0. Recommended: production+city in one region, DR in another region for non-storage-replication HA.
2.2 Lightweight TPOPS HA Deployment
TPOPS manages GaussDB without Huawei Cloud foundation. Deploy TPOPS platform, then register/maintain instances. Flexible deployment topologies.
1) Production Intra-City Single Region Deployment
Same as HCS: DN replication supports Quorum and Paxos; cross-AZ sync standby → no data loss.
2) Intra-City 3AZ 5-Node + Cross-Region 1AZ 1-Node (Intra-City RPO=0)
Intra-city active-active: two business AZs + one arbitration AZ. Peer deployment, both serve traffic; arbitration AZ no traffic. Any single AZ failure → RPO=0 . Cross-region provides DR.
Intra-city and cross-region each deploy separate database clusters.
Single AZ failure: ETCD majority survives → data consistency.
DN primary-standby streaming replication, sync to at least 2 standbys → RPO=0 .
Intra-city supports cross-AZ switchover; cross-region DR requires manual switchover.
Compared to HCS: cross-region supports single-node deployment; production+city not bound to cloud region network domains → more flexible deployment.
3. Summary
Huawei Cloud GaussDB HA architecture guarantees: AZ-level RPO=0, intra-city cross-AZ RPO=0, cross-region RPO<10s . Flexible configurations for different scenarios. Key characteristics:
Odd-number deployment for ETCD/log replicas to ensure majority election success for consistency protocols.
Centralized architecture decouples control plane from database instances : each cluster has own metadata management and fault detection nodes, independent for fault detection and DDL changes. Control plane handles resource management, metric collection/display. Trade-off: more nodes to maintain (each cluster has own ETCD, CMS, etc.).
Without existing Huawei Cloud foundation, lightweight TPOPS deployment is more suitable : database not locked to a specific cloud vendor, deployment schemes more flexible.
GaussDB on cloud foundation + management platform provides unified instance management, metric collection/display, DBMind intelligent ops, and DRS migration tools with Oracle compatibility/performance advantages — competitive in domestic database adoption. One critique: instance deployment minimum resource limit is 8C64G , enforced during registration, unfriendly for small apps or dev/test environments.
Reference:
https://doc.hcs.huawei.com/db/zh-cn/gaussdbqlh/24.1.30/tg/gaussdb-38-0122.html
For questions about attribution, corrections or content rights, please contactand we will review it promptly.