Database Replication Strategies
Database replication keeps copies of database changes on more than one system. A replication strategy decides where writes happen, how changes travel, when a commit is acknowledged, and what readers may see when a replica lags or a node fails.
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 Replication Strategies
Database replication copies database changes to other servers or regions. It can improve availability, place reads nearer to users, isolate reporting, support migrations, or feed another system. It is not a backup. A replica can copy your most regrettable delete with admirable speed.
Think in seven stages: authority, order, transport, acknowledge, apply, route, and recover. Authority says who may accept writes. A single-primary design has one writer. Multi-primary and leaderless designs allow more write locations but need conflict prevention, rejection, or repair. Consensus systems use a voting group to keep one ordered history, often by stopping writes in a minority partition.
Order comes from a change log: write-ahead log, binary log, oplog, or replicated command log. Transport moves that history. Apply makes it queryable. These are not the same moment. A replica can receive a change before it durably stores it, and store it before readers can observe it.
The acknowledgment point is the promise. Asynchronous replication returns before a remote replica confirms the change, so remote latency stays away from normal commits but acknowledged writes may be absent after primary loss. Synchronous modes wait for a configured remote point. That can reduce loss and increase waiting, which is the sort of trade that should be named before the incident.
Routing decides what clients observe. Replica reads may be stale. Read-your-writes needs routing back to the writer, session pinning, or waiting for a replica position. Failover needs fencing so the old writer cannot keep accepting changes after promotion.
Use the Practice Reference to write the strategy record and rehearse failover. Do the Exercise to choose authority, acknowledgment, reads, monitoring, and recovery. The Cheatsheet keeps topology, quorums, lag, retention, and failure decisions close. Replication is useful because it is explicit about tradeoffs, not because copies are comforting.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://www.postgresql.org/docs/current/high-availability.html
Supports
- Replication purposes, shared-storage and log-shipping approaches, read scaling, failover, and replication limits
- https://www.postgresql.org/docs/current/warm-standby.html
Supports
- WAL streaming and archive flow, base backup, positions, asynchronous and synchronous acknowledgment, cascading replication, promotion, lag, and security
- https://www.postgresql.org/docs/current/logical-replication.html
Supports
- Physical versus logical distinction, publication and subscription, initial snapshot, ordered apply, filters, conflicts, restrictions, monitoring, and security
- https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS
Supports
- Replication slots, retained WAL, consumer progress, storage growth, and lost-history rebuild risk
- https://dev.mysql.com/doc/refman/8.4/en/group-replication-replication-technologies.html
Supports
- Source-to-replica, asynchronous and semi-synchronous replication, group replication, single-primary and multi-primary context
- https://dev.mysql.com/doc/refman/8.4/en/replication-formats.html
Supports
- Statement-based, row-based, and mixed binary-log replication formats and their tradeoffs
- https://dev.mysql.com/doc/refman/8.4/en/group-replication.html
Supports
- Group membership, primary modes, consensus, election, failure detection, partitions, distributed recovery, monitoring, and client-routing boundary
- https://dev.mysql.com/doc/refman/8.4/en/group-replication-understanding-consistency-guarantees.html
Supports
- Read-after-write staleness, asynchronous apply inside a group, consistency synchronization points, and routing implications
- https://www.mongodb.com/docs/manual/replication/
Supports
- Replica-set primary and secondary roles, oplog, asynchronous flow, elections, read preference, rollback risk, and deployment uses
- https://www.mongodb.com/docs/manual/applications/replication/
Supports
- Read preference, write concern, server selection, read and write semantics, and application-visible behavior
- https://www.mongodb.com/docs/manual/core/replica-set-write-concern/
Supports
- Replica acknowledgments, majority durability, latency tradeoff, and timeout ambiguity
- https://www.mongodb.com/docs/manual/core/replica-set-sync/
Supports
- Initial and continuing synchronization, oplog streaming, apply ordering, source selection, and flow control
- https://www.amazon.science/publications/dynamo-amazons-highly-available-key-value-store
Supports
- 2007 publication, leaderless replication, consistent hashing, versions, vector clocks, quorums, hinted handoff, read repair, and availability tradeoffs
- https://research.google/pubs/spanner-googles-globally-distributed-database-2/
Supports
- 2012 publication, synchronous global replication, consensus, external consistency, transactions, and clock uncertainty
- https://cloud.google.com/spanner/docs/replication
Supports
- Synchronous Paxos-based split replication, voting replicas, leaders, placement, and strong reads
- https://doi.org/10.1145/62546.62549
Supports
- 1988 publication of Viewstamped Replication as a primary-copy method for highly available distributed systems
- https://www.microsoft.com/en-us/research/publication/part-time-parliament/
Supports
- May 1998 publication of Paxos and majority progress with consistency under non-Byzantine failures
- https://www.microsoft.com/en-us/research/publication/paxos-made-simple/
Supports
- December 2001 publication and concise consensus explanation used in the study path
- https://www.usenix.org/conference/atc14/technical-sessions/presentation/ongaro
Supports
- June 2014 Raft publication, leader election, replicated log, safety, overlapping-majority membership change, and majority behavior
- https://www.postgresql.org/docs/9.0/release-9-0.html
Supports
- September 2010 PostgreSQL streaming replication and hot standby milestone
- https://www.postgresql.org/docs/9.1/release-9-1.html
Supports
- September 2011 PostgreSQL synchronous replication milestone
- https://www.postgresql.org/docs/10/release-10.html
Supports
- October 2017 PostgreSQL built-in logical replication publication and subscription milestone
- https://github.com/sindresorhus/awesome
Supports
- Required Awesome-list discovery starting point and database-list navigation
- https://github.com/mgramin/awesome-db-tools
Supports
- Discovery of Litestream, repmgr, pg_chameleon, and data-diff from replication, high-availability, and data-comparison sections
- https://litestream.io/how-it-works/
Supports
- SQLite WAL page streaming, asynchronous replica destination, snapshots, retention, and restoration
- https://www.repmgr.org/docs/current/
Supports
- PostgreSQL replication status, clone, switchover, failover, follow, and rejoin operations
- https://pgchameleon.org/documents/
Supports
- MySQL row-image extraction, transformation, PostgreSQL apply, initial copy, cascading source, and error handling
- https://github.com/datafold/data-diff
Supports
- Cross-database row comparison for migration and replication validation
- https://www.postgresql.org/
Supports
- PostgreSQL Landscape identity and engine-native physical and logical replication placement
- https://www.mysql.com/
Supports
- MySQL Landscape identity and source-replica or group replication placement
- https://www.mongodb.com/atlas
Supports
- MongoDB Atlas Landscape identity and managed replica-set placement
- https://www.oracle.com/database/data-guard/
Supports
- Oracle Data Guard Landscape identity and redo-based physical or logical standby placement
- https://www.microsoft.com/en-us/sql-server/sql-server-downloads
Supports
- SQL Server Landscape identity and availability-group replica placement
- https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server
Supports
- Availability group primary and secondary roles, synchronous or asynchronous commit, readable secondaries, and failover
- https://aws.amazon.com/rds/aurora/global-database/
Supports
- Aurora Global Database Landscape identity, storage-based cross-region replication, local reads, and single-primary placement
- https://cloud.google.com/spanner
Supports
- Spanner Landscape identity and managed synchronous consensus replication placement
- https://www.cockroachlabs.com/product/cockroachdb/
Supports
- CockroachDB Landscape identity and range-level consensus replica placement
- https://www.cockroachlabs.com/docs/stable/architecture/replication-layer
Supports
- Range replicas, leaseholders, Raft consensus, quorum writes, and rebalancing
- https://www.yugabyte.com/yugabytedb/
Supports
- YugabyteDB Landscape identity and consensus plus xCluster replication placement
- https://docs.yugabyte.com/stable/architecture/docdb-replication/
Supports
- Tablet peers, Raft leaders, quorum replication, and synchronous write path
