Free audit

View Audit Scope

Multi-Database HA Architecture

Database High Availability: One Specialist for Your Entire Database Tier

Executive Direct Answer · High Availability Architecture

Database high availability (HA) is a multi-node architecture that maintains database operations during server, network, or availability zone failures through automated consensus failover and replication. JusDB engineers and validates production HA topologies—including Patroni clustering, MySQL Group Replication, and Cassandra multi-region active-active—and measures RTO and RPO in failover drills. Availability and response commitments: defined in your service agreement.

Failover RTO: Measured in Drills·RPO: Quorum / Synchronous Options·Topology: Active-Active Multi-Region·ISO 27001 & SOC 2 Type II: aligned, certification in progress

JusDB architects and implements high availability across MySQL, PostgreSQL, MongoDB, Cassandra, SQL Server, and MariaDB — multi-AZ failover, multi-region active-active replication, cloud-native HA patterns, and automated runbook execution so your databases stop being the single point of failure.

Need HA for a single database engine? Jump to the database-specific HA implementation guide: PostgreSQL HA → MySQL HA → MongoDB HA →

Why You Need a Multi-Database HA Specialist

Modern applications rarely run on a single database engine. The team that builds your MySQL HA topology may not understand Cassandra multi-DC replication — or MongoDB replica set elections. A specialist in only one database leaves the rest of your stack exposed.

6 Database Engines

MySQL, PostgreSQL, MongoDB, Cassandra, SQL Server, and MariaDB — JusDB architects HA for all of them, with deep knowledge of each engine's unique failover mechanics and replication semantics.

Multi-Region Active-Active

Design globally distributed topologies where writes are accepted in multiple regions simultaneously. Includes conflict resolution strategy, latency budgets, and regional failure isolation.

Cloud-Native HA Patterns

Multi-AZ deployments on AWS, GCP, and Azure. Leverage managed services (RDS Multi-AZ, Cloud SQL HA, Atlas Global Clusters) where appropriate, self-managed where control is required.

Automated Failover & Runbooks

Failover must be automatic: a human-initiated failover adds paging and decision time to every incident. JusDB implements and validates fully automated failover with runbook execution via Rundeck or custom operators.

Chaos Engineering Validation

HA that has not been tested is not HA. JusDB runs systematic failure injection — node kills, network partitions, AZ failures — to verify actual RTO and RPO against your SLOs before a real incident.

AI Anomaly Detection

Detect replication lag, connection saturation, and disk pressure before they cause a failover. JusDB integrates anomaly detection on top of your Prometheus/Grafana stack to give pre-incident warning.

HA Patterns: Which One Fits Your Workload?

The right HA pattern depends on your RTO requirement, RPO requirement, write volume, and geographic distribution. JusDB maps your SLOs to the appropriate architecture — not the other way around. Timings in the table are vendor-documented defaults or typical figures, not JusDB commitments; we measure yours in failover drills.

HA PatternDescriptionFailover (RTO)Data at risk (RPO)Best For
Multi-AZ Active-PassiveA primary in one Availability Zone and a standby in a second. With synchronous replication (semisynchronous in MySQL), each commit waits until the standby has it, so failing over to that standby keeps every acknowledged transaction. The cost is added commit latency. If the standby drops out, the primary either blocks commits or carries on without that protection, depending on configuration. AWS documents typical RDS Multi-AZ DB instance failovers of 60 to 120 seconds.Detect the failure, promote the standby, repoint clientsNone acknowledged, while the standby is in sync
MySQLPostgreSQLSQL Server
Multi-Region Active-ActiveMore than one region takes writes. Cassandra resolves conflicting writes by timestamp (last write wins), and a write acknowledged at LOCAL_QUORUM has waited only for replicas in its own data center. CockroachDB commits each write through a Raft quorum, so nothing needs reconciling, but every write waits for that quorum. Cockroach Labs documents a few seconds to move a failed node's leases. MongoDB writes go to one primary per shard, so multi-region writes need zone sharding (Atlas Global Clusters).Cassandra promotes nothing; CockroachDB leases and MongoDB shard primaries take seconds to moveSet by the write consistency level
CassandraCockroachDBMongoDB
Read Replica Scaling + HAOne primary takes writes; asynchronous replicas serve reads, and one is promoted on failure. Writes stay fast because the primary never waits, but a promoted replica lacks whatever it had not yet received. In Patroni, maximum_lag_on_failover sets how far behind a PostgreSQL replica can be and still be promoted. In MongoDB, writes acknowledged by a majority of members (the default write concern in most deployments) are not rolled back, and MongoDB documents a median election time that should not typically exceed 12 seconds with default settings. Useful when reads dominate the load.Promote the most caught-up replica, repoint clientsWrites the replica had not yet received
MySQLPostgreSQLMongoDB
Galera / Group ReplicationEach transaction reaches every member in the same order and is certified before it commits, so surviving members keep every committed transaction. Group Replication needs a majority of members to keep committing and runs single-primary by default. Multi-primary mode and Galera let any node take writes, and the later of two conflicting transactions rolls back. The cost is commit latency on every write. With MySQL defaults, a silent member is liable for expulsion after about 10 seconds (a 5-second detection period plus the 5-second expel timeout).Expel the failed node; Group Replication elects a new primaryNone committed, while the group keeps quorum
MySQLMariaDB

HA Tool Stack by Database

Each database engine has its own HA ecosystem. JusDB selects and implements the right tools for your engine, your cloud provider, and your RTO/RPO requirements.

MySQL HA Stack

  • Orchestrator (topology management)
  • Group Replication / Galera
  • ProxySQL (R/W split + failover)
  • MHA (Master HA)
MySQL specialist page

PostgreSQL HA Stack

  • Patroni (etcd/Consul DCS)
  • repmgr (replication and failover management)
  • PgBouncer / Pgpool-II (pooling)
  • pgBackRest (PITR)
PostgreSQL specialist page

MongoDB HA Stack

  • Replica sets (3-node minimum)
  • Sharded cluster topology
  • Mongos routing layer
  • Atlas Global Clusters
MongoDB specialist page

Cassandra HA Stack

  • Multi-DC replication (NetworkTopologyStrategy)
  • Gossip protocol failure detection
  • Read repair + hinted handoff
  • Nodetool monitoring
Cassandra specialist page

MySQL / MariaDB HA Stack

  • MaxScale (intelligent routing)
  • Galera Cluster
  • GTID-based replication
  • Semi-sync replication
MySQL / MariaDB specialist page

SQL Server HA Stack

  • Always On Availability Groups
  • Failover Cluster Instances (FCI)
  • Database Mirroring (legacy)
  • Log Shipping
SQL Server specialist page

Cloud Provider HA: Managed vs Self-Managed

When to use Managed HA

Managed database services (RDS Multi-AZ, Cloud SQL HA, Atlas) handle failover mechanics but abstract away control. Use when:

  • The provider's documented failover time fits your RTO (AWS gives 60 to 120 seconds as typical for RDS Multi-AZ DB instances)
  • Team lacks DBA capacity to manage replication
  • Engine version and extensions are ones the managed service supports
  • Cloud vendor lock-in is acceptable for the workload
  • Automated backups and PITR are required with minimal ops burden

When to use Self-Managed HA

Self-managed HA (Patroni, Orchestrator, Cassandra multi-DC) gives full control over failover timing and topology. Use when:

  • Failure-detection and failover timing must be tuned beyond what a managed service exposes
  • Multi-cloud or hybrid cloud topology (AWS + GCP + on-prem)
  • Custom extensions or configurations not supported by managed services
  • Need to control replication topology (cross-region routing, selective replication)
  • Cost at scale makes managed services prohibitive (>$50k/month DB spend)

High Availability Failure Modes We Engineer Against

Standard high availability designs look resilient on architectural diagrams but frequently break during real-world network partitions and node crashes. JusDB hardens database topologies against these catastrophic edge cases:

P1 Emergency · Irrecoverable Data Loss

Distributed DCS Split-Brain & Dual-Primary Divergence

A transient network partition between distributed consensus nodes (etcd, Consul) causes a quorum loss on the primary while the replica elects a new leader. Both nodes accept concurrent writes, producing irrecoverable database split-brain data corruption.

JusDB Architecture Mitigation:

We configure strict majority quorum rules, enforce hardware-assisted STONITH fencing, and tune lease TTLs with automatic client isolation to prevent rogue writes.

P1 Critical · Post-Failover Service Outage

Cascading Connection Thundering Herd on Failover

When a failover occurs, hundreds of application microservice instances reconnect simultaneously to the newly elected primary. The massive spike in backend TCP connections and buffer pool cache misses crashes the new leader immediately.

JusDB Architecture Mitigation:

We implement connection multiplexing via transaction-mode poolers (PgBouncer, ProxySQL) that queue incoming connections and rate-limit client reconnect storms.

P1 Critical · Primary Database Freeze

Replication Slot Lag & Disk Space Starvation

A lagging standby holds an active replication slot. The primary continues retaining all WAL segments on disk to prevent the replica from falling behind, eventually filling the root disk to 100% and causing a hard crash of the primary instance.

JusDB Architecture Mitigation:

We tune max_slot_wal_keep_size, implement automated alert monitors for replication slot byte lag, and configure auto-dropping policies for permanently dead standby nodes.

Telemetry Runbooks · Consensus & Replication Quorum Verification

Our SREs monitor distributed consensus heartbeats and replication stream lag in real-time to detect impending failover stalls before client requests time out:

PostgreSQL: Patroni & Replication Quorum HealthTelemetry
# 1. Inspect Patroni DCS cluster leader lease & DCS health
patronictl -c /etc/patroni/patroni.yml list

-- 2. Verify synchronous standby replication lag & sync state
SELECT application_name, client_addr, state, sync_state, sync_priority,
       pg_wal_lsn_diff(pg_current_wal_lsn(), write_lsn) AS write_lag_bytes,
       pg_wal_lsn_diff(pg_current_wal_lsn(), replay_lsn) AS replay_lag_bytes
FROM pg_stat_replication;
MySQL: Group Replication Quorum & Certification QueuePerf Schema
-- 1. Check Group Replication member state & cluster quorum
SELECT member_id, member_host, member_port, member_state, member_role
FROM performance_schema.replication_group_members;

-- 2. Inspect conflict detection & transaction backlog queue
SELECT COUNT_TRANSACTIONS_IN_QUEUE,
       COUNT_TRANSACTIONS_CHECKED,
       COUNT_CONFLICTS_DETECTED,
       COUNT_TRANSACTIONS_ROWS_VALIDATING
FROM performance_schema.replication_group_member_stats;

How JusDB High Availability compares to alternative models.

True high availability requires rigorous consensus protocols, non-blocking failovers, and verified split-brain fencing. Here is how JusDB compares to cloud provider Multi-AZ, generic MSPs, and internal on-call teams.

HA Dimension
JusDB HA Engineering
Cloud Providers (RDS/Cloud SQL)Generic MSPsIn-House On-Call Teams
Failover RTO & Leader ElectionAutomated failover via Patroni (etcd/Consul), MySQL Orchestrator, and ProxySQL connection redirection, with RTO measured in failover drills against your SLOsMulti-AZ failover takes 60–120 seconds with client DNS caching delays and transient connection dropsRelies on basic primary-replica setups requiring manual engineer verification and promotion runbooksManual failovers executed under incident pressure, taking 15–45 minutes of application downtime
RPO Targets & Replication QuorumSynchronous or quorum replication options designed for RPO = 0 where the topology allows, with GTID tracking and replication-slot lag guards; RPO targets agreed per workloadMulti-AZ standbys replicate synchronously, but read replicas are asynchronous and lag under write bursts; promoting one can lose recent writesBasic async replication without automated replication delay throttling or data loss preventionUnmonitored replication lag leading to lost transactions or stale reads when primary fails unexpectedly
Split-Brain Prevention & Node FencingStrict distributed consensus fencing (etcd/Consul DCS, Keepalived, STONITH) preventing dual-primary divergenceProvider-managed control plane; failover and fencing logic is not visible or configurableLacks robust node isolation; network blips risk accidental dual-primary writes and split-brain data corruptionHigh risk of promoting a replica while the isolated old primary continues accepting writes
Failover Drills & ValidationFailover and network-partition drills, where your agreement or an HA/DR project includes them, measuring actual RTO and RPO against your SLOsYou can trigger a failover (for example, a reboot with failover), but planning, running, and measuring drills stays with your teamNo regular chaos testing; failovers are tested only during real production catastrophic outagesTeams avoid failover testing due to fear of breaking production, leaving recovery untested until a disaster strikes
Incident Response & EscalationNamed senior DBREs join your incident bridge. Initial-response targets: 2 to 4 hours in covered business hours; 15 minutes for P1 incidents with 24x7 on-call. Targets, not resolution guarantees.Provider support plans with severity-based response targets; platform scope, not query or schema workOffshore ticket triage with high turnover and slow escalation to senior database engineersExhausted on-call developers waking up at 3 AM to troubleshoot unfamiliar distributed consensus alerts
Multi-Region & Hybrid Cloud TopologyActive-active multi-region and cross-cloud topologies across AWS, GCP, Azure, on-premises, and Kubernetes operatorsLocked to single-vendor cloud primitives; cross-cloud or on-prem hybrid HA is unsupported or complexLimited to standard single-datacenter VPS configurations without multi-region routing expertiseSingle cloud-region dependency exposing the entire business to catastrophic regional cloud outages
RTO and RPO targets are agreed per workload and validated in failover drills.ISO 27001 & SOC 2 Type II: aligned, certification in progress

FAQ

High availability keeps a database serving through the loss of a node or an Availability Zone, usually by failing over to a replica in the same region. Disaster recovery covers the loss of a whole region, from a cross-region replica or from backups, and usually accepts a longer recovery time and more potential data loss. JusDB designs both, but they use different tooling and cost structures. Most organizations need HA plus a separate DR runbook, not one system trying to do both.

Yes. Multi-cloud HA is more complex: you need a network fabric (Tailscale, Cloudflare WAN, or private interconnects), latency-aware routing, and replication that works across provider boundaries. JusDB has designed multi-cloud topologies for Cassandra, PostgreSQL (with Patroni + custom DCS), and MongoDB Atlas Global Clusters. We always model the latency and cost impact before recommending it.

Through chaos engineering. JusDB runs systematic failure injection after every HA implementation: kill the primary node, partition the network, stop the replication process, exhaust disk space on the replica. We measure actual RTO and RPO against your SLOs and document the results. HA that has only been tested in a demo is not production HA.

JusDB does not quote one RTO figure: failover time depends on the engine, the HA pattern, and how failure detection is tuned, so we measure it on your cluster in failover drills. Vendor defaults give the order of magnitude. Patroni starts an automatic failover only after the leader lock expires, 30 seconds by default. MySQL Group Replication can expel a silent member after about 10 seconds with default settings. MongoDB documents a median election time that should not typically exceed 12 seconds. Cassandra has no primary to promote, and a distributed SQL cluster such as CockroachDB still needs a few seconds to move a failed node's leases.

Yes. JusDB has implemented HA for databases running on Kubernetes using operators: Patroni-based PostgreSQL operators, the Percona Operator for PostgreSQL, the MongoDB Community Operator (which MongoDB has since replaced with the MongoDB Controllers for Kubernetes Operator), and Vitess. Kubernetes adds complexity — pod anti-affinity rules, PVC topology constraints, network policies — but also enables faster pod rescheduling than bare-metal equivalents.

Make your entire database tier resilient — not just one engine

JusDB reviews your current HA topology, identifies single points of failure, designs the right HA pattern for each database, and validates it with chaos engineering before it ever matters in production.