Database High Availability
Database high availability ensures that a database remains accessible despite hardware failures, network partitions, or planned maintenance. It uses replication, failover, clustering, and load distribution so that applications experience minimal or zero downtime.
itDatabases and data storage | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Database High Availability
Database high availability is the art of keeping a database service useful when some part of its supporting machinery has gone sideways. The reassuring diagram has a primary and several standbys. The less reassuring reality also has routers, connection pools, voting members, timeouts, and an application waiting to find out whether that last commit happened. The diagram omitted those because diagrams are kind.
Begin with the two labels that keep arguments from escaping into the ceiling. Recovery time objective, or RTO, is how long the resource may be unavailable. Recovery point objective, or RPO, is how far back its data may return after an outage. One governs detection, promotion, routing, and reconnection. The other governs which replication and commit guarantee is acceptable. A design with no stated objectives is not flexible. It is waiting for a surprise to choose them.
The central trick is that copies need permission. Replication moves changes from the writer to standby servers, but a network partition can leave healthy machines unable to talk. Quorum, the voting set allowed to decide, keeps the minority from inventing its own writable future. This feels rude when the minority has perfectly good hardware and urgent opinions. It is still kinder than producing two histories and asking someone to merge them after lunch.
Failover is therefore a controlled change of authority, not a magic button. Detect the failure, confirm the decision is safe, fence the old primary so it cannot accept writes, select a suitable standby, promote it, move routing, and let clients reconnect. Miss the routing step and the new primary has achieved an impressive private victory. Miss fencing and the old primary may keep writing somewhere you cannot see.
The surprising part is that a healthy standby does not prove availability. Existing connections can break, pools can retain stale sockets, and a dropped commit response leaves an unknown outcome. Retries need limits and an operation must be safe to repeat or identifiable enough to check. The database cannot decide whether charging an order twice was a clever recovery strategy.
Replication also is not a time machine. Asynchronous replicas can be behind, and a bad update can reach every current copy. Backups preserve older recovery points. Read the intro for the full service path and failure model, the slides for the sequence and tradeoffs, and the cheatsheet for quorum arithmetic, signals, and tests. Then test a switchover, a failure, and a restore. That is where an availability claim stops being decorative.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-34r1.pdf
Supports
- Recovery point objective and recovery time objective definitions
- Business impact analysis, recovery priorities, contingency procedures, testing, and plan maintenance
- https://www.postgresql.org/docs/current/high-availability.html
Supports
- High availability and load-balancing purposes
- Primary, standby, warm standby, and hot standby terminology
- Synchronous and asynchronous replication behavior, data risk, consistency, and performance tradeoffs
- https://www.postgresql.org/docs/current/warm-standby.html
Supports
- Log shipping, streaming replication, standby promotion, and failover behavior
- Replication position and lag monitoring
- Synchronous commit acknowledgment, latency, and durability behavior
- Replication slots, retained log pressure, and standby reinitialization risks
- https://dev.mysql.com/doc/refman/8.4/en/group-replication.html
Supports
- Group membership, single-primary and multi-primary modes, failure tolerance, and automatic primary election
- Group Replication requirements, limitations, monitoring, consistency, and recovery topics
- https://dev.mysql.com/doc/refman/8.4/en/group-replication-performance.html
Supports
- Failure detection, member expulsion, automatic rejoin, network partition, quorum loss, and stopped transaction processing
- Performance, workload, message-size, and administrator-intervention considerations
- https://dev.mysql.com/doc/refman/8.4/en/group-replication-failure-detection.html
Supports
- Distributed failure suspicion and coordinated member expulsion
- Majority agreement for transactions and membership-view changes
- Isolated members cannot establish a new group view without quorum
- https://dev.mysql.com/doc/mysql-shell/8.4/en/mysql-innodb-cluster.html
Supports
- InnoDB Cluster topology, Group Replication, built-in failover, and primary promotion
- MySQL Router integration and transparent routing to the new primary
- Cluster fencing and recovery topics
- https://dev.mysql.com/doc/mysql-router/8.4/en/mysql-router-general-metadata.html
Supports
- Router placement between applications and database members
- Topology and live-state discovery
- Closed connections after backend loss and reconnection through another online member
- https://www.mongodb.com/docs/manual/core/replica-set-elections/
Supports
- Majority voting, primary elections, member priority, election triggers, write interruption, and rollback exposure
- https://www.mongodb.com/docs/manual/core/replica-set-write-concern/
Supports
- Write acknowledgment counts, majority durable commit, timeout behavior, latency, and rollback-risk tradeoffs
- https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/design-principles.html
Supports
- Testing recovery procedures, simulating failure scenarios, validating recovery, and correcting failure paths
- Distributing components to avoid a shared point of failure and planning capacity from measured demand
- https://aws.amazon.com/builders-library/timeouts-retries-and-backoff-with-jitter/
Supports
- Bounded timeouts, retry side effects, idempotent operations, retry limits, and backoff behavior
- https://www.postgresql.org/docs/8.0/release-8-0.html
Supports
- PostgreSQL 8.0 point-in-time recovery and continuous backup
- https://www.postgresql.org/docs/9.0/release-9-0.html
Supports
- PostgreSQL 9.0 streaming replication and hot standby release
- https://www.postgresql.org/docs/9.1/release-9-1.html
Supports
- PostgreSQL 9.1 synchronous replication, streaming backup, and monitoring enhancements
- https://www.postgresql.org/docs/9.4/warm-standby.html
Supports
- PostgreSQL replication slots and cascading replication
- https://dev.mysql.com/blog-archive/mysql-group-replication-its-in-5-7-17-ga/
Supports
- MySQL Group Replication general availability in MySQL 5.7.17
- https://dev.mysql.com/blog-archive/mysql-innodb-cluster-ga/
Supports
- MySQL InnoDB Cluster general availability and its server, Shell, and Router components
- https://aws.amazon.com/about-aws/whats-new/2018/11/announcing-amazon-aurora-global-database/
Supports
- Aurora Global Database launch and cross-Region replication purpose
- https://aws.amazon.com/blogs/database/introducing-aurora-global-database-failover/
Supports
- Aurora Global Database Failover, promoted-secondary preparation, configuration, and dependency requirements
- https://aws.amazon.com/blogs/database/managed-planned-failovers-with-amazon-aurora-global-database/
Supports
- Planned cross-Region failover, synchronization, temporary unavailability, capacity, and configuration checks
- https://aws.amazon.com/blogs/database/improving-application-availability-with-amazon-rds-proxy/
Supports
- Client connection recovery as part of observed failover time
- https://www.postgresql.org/
Supports
- PostgreSQL product landscape entry
- https://www.mongodb.com/atlas/database
Supports
- MongoDB Atlas product landscape entry
- https://aws.amazon.com/rds/
Supports
- Amazon RDS product landscape entry
- https://aws.amazon.com/rds/aurora/
Supports
- Amazon Aurora product landscape entry
- https://cloud.google.com/sql
Supports
- Google Cloud SQL product landscape entry
- https://azure.microsoft.com/en-us/products/azure-sql/database
Supports
- Azure SQL Database product landscape entry
- https://www.cockroachlabs.com/product/
Supports
- CockroachDB product landscape entry
- https://www.yugabyte.com/yugabytedb/
Supports
- YugabyteDB product landscape entry
