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
Intro
Database Replication Strategies
Database replication copies database changes from one server or region to another. The copies can improve availability, place reads near users, isolate reporting work, support migrations, or feed another system. A useful strategy specifies more than the number of copies. It defines who may accept writes, what is replicated, how changes are ordered, when a write is considered durable, how readers select a copy, and how a failed member returns.
Replication is not the same as backup. A replica normally receives valid changes and mistakes from its source. A dropped table, damaging update, or application bug can therefore reach every live copy. Independent backups and archived logs preserve earlier recovery points; replicas preserve a current or nearly current service path.
The replication path
A common primary-replica path has five stages:
- A client sends a transaction to the primary.
- The primary orders the transaction and records it in a durable change log.
- A transport sends log records or logical changes to one or more replicas.
- Each replica writes and applies the change to its local state.
- Acknowledgment and read-routing rules determine when the client receives success and which copy may answer later reads.
The change log gives replicas an ordered stream to follow. PostgreSQL physical streaming replication sends write-ahead log records. MongoDB secondaries copy and apply operations from the oplog. MySQL source-to-replica replication uses the binary log. The implementation differs, but the design questions are similar: how a replica starts, how it identifies its position, how long retained history remains available, and what happens when it falls behind that history.
Initial synchronization establishes the first complete copy. A replica then consumes incremental changes from a known position. If the source discards required log history before a disconnected replica returns, the replica usually needs a fresh snapshot or base backup. Retention protects recoverability, but retained logs also consume storage.
Continue the course
This section is part of the paid course.
See pricing to subscribe, or log in if you already have access.
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
