CLOUD CONCEPT

Database Replication

Database replication copies database data and propagates changes to other database instances or locations to support migration, availability, and read scaling.

Cloud Concepts Hub →

What is Database Replication

Database replication maintains additional copies of database data by transferring an initial dataset and subsequent changes. In cloud migrations, it lets the source database continue serving applications while a target catches up, reducing the downtime needed to switch environments. Replication also supports resilience and distributed reads, but its consistency, recovery, and cost characteristics depend on the implementation.

Database replication maintains copies of database data across database instances, infrastructure environments, or geographic locations. It usually begins with an initial copy, followed by a mechanism that transfers subsequent inserts, updates, and deletes. Replication can operate at the storage, transaction-log, or logical-data level, and it can cover an entire database or selected tables. Its main purposes include migration, high availability, disaster recovery, and read scaling.

For cloud migration, replication is useful when a database is too large or too business-critical for a lengthy offline transfer. For example, an organization moving an on-premises order database to a managed cloud database can load existing records into the target while customers continue placing orders on the source. Change data capture, often abbreviated CDC, then transfers ongoing changes from the source transaction logs. This approach reduces downtime, but it does not automatically eliminate the need for a controlled cutover.

A practical cutover involves validating the target, stopping or restricting source writes, allowing outstanding changes to reach the target, and redirecting application connections. Engineers should check replication lag, data correctness, application compatibility, permissions, and connection configuration before switching traffic. A rollback plan must account for writes accepted by the new target; simply reconnecting applications to the old source can lose access to those changes unless reverse synchronization or another reconciliation process exists.

Replication can support either a same-engine migration or a migration between different database engines when tooling supports that combination. A same-engine move generally requires fewer application changes. A cross-engine move can also require schema conversion, SQL changes, data-type mapping, and replacement of stored procedures or engine-specific features. Replication moves supported data changes; it does not automatically make incompatible database engines or application code compatible. It is a migration technique, not a complete migration strategy by itself.

Synchronous replication makes write completion depend on acknowledgment from designated replicas or a quorum, according to the system's rules. It can strengthen durability guarantees but adds communication latency and may reduce write availability during connectivity failures. Asynchronous replication lets the source commit without waiting for replicas, improving write responsiveness but allowing replication lag. Applications reading a lagging replica might not immediately see a recently committed update, and failover can lose changes that never reached the replacement.

Replication should not be confused with backup. An accidental deletion or harmful update can propagate to replicas, so independent backups and point-in-time recovery remain important. A replica also does not necessarily accept reads, support automatic failover, or increase write throughput. Those capabilities depend on the database architecture and configuration.

Operational planning includes network bandwidth, transfer charges, replica capacity, encryption, access control, and monitoring. Log retention must accommodate outages so replication can resume without requiring another full load. For migration exam scenarios, recognize ongoing database replication as a way to keep a target current while the source remains operational, followed by a planned, validated cutover.

Key aspects of Database Replication

Effective database replication combines reliable change propagation with explicit decisions about cutover, consistency, replica roles, compatibility, and recovery.

Initial copy and ongoing synchronization

Replication commonly combines a baseline data load with continuous propagation of changes. Ensure that changes occurring during the initial load are captured so the target can reach a consistent state.

Reduced-downtime migration

The source can continue serving applications while the destination loads and catches up. Schedule a controlled cutover to stop conflicting writes, apply remaining changes, validate the target, and redirect connections.

Consistency and replication lag

Synchronous and asynchronous replication make different latency, availability, and durability trade-offs. Monitor lag and determine whether stale reads or loss of unreplicated writes are acceptable for the workload.

Topology and replica roles

Single-writer designs direct changes from one primary to replicas, while multi-writer designs require mechanisms for coordinating or resolving concurrent changes. Verify whether each replica supports reads, promotion, or writes rather than assuming all copies have the same role.

Compatibility and validation

Supported engines, data types, schema changes, and database objects vary by replication mechanism. Cross-engine migrations often require separate schema conversion and application testing in addition to data replication.

Recovery and operational safeguards

Replication requires monitoring, sufficient log retention, secure connectivity, and a tested recovery process. Keep independent backups because replicas can reproduce accidental deletions and other unwanted changes.

Cloud services for Database Replication

AWS DMS can load a supported source database into an Amazon RDS or Aurora target and replicate ongoing changes until a planned migration cutover. After migration, the target database's native replication features address availability, failover, or read scaling; these are separate concerns from the migration task. DynamoDB global tables apply replication to a different database model, maintaining tables across Regions for distributed applications. These services are not interchangeable: choose migration tooling for transferring changing datasets and database-native replication for the target workload's ongoing consistency and resilience requirements. Independent backups remain necessary in every design.

Amazon RDS image Amazon RDS

Amazon RDS provides engine-dependent replication options for availability and read scaling. A traditional Multi-AZ DB instance deployment uses a synchronous standby that does not serve reads, while read replicas generally use asynchronous replication; Multi-AZ DB clusters have different architectures and readable instances.

Open Amazon RDS →
Amazon Aurora image Amazon Aurora

Aurora replicates cluster storage across multiple Availability Zones and supports Aurora Replicas for reads and failover. Aurora Global Database extends replication across AWS Regions, with asynchronous cross-Region replication that requires consideration of lag and recovery behavior.

Open Amazon Aurora →
Amazon DynamoDB image Amazon DynamoDB

DynamoDB global tables provide managed, multi-Region, multi-active replication. Consistency guarantees, supported configurations, and concurrent-write behavior depend on the selected consistency mode, so applications must be designed around that mode's semantics.

Open Amazon DynamoDB →