Cloud concept · Updated

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

In short

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.

Cloud Concepts Hub →

6 key aspects of Database Replication

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

01
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.

02
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.

03
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.

04
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.

05
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.

06
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 RDSAmazon 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.

Amazon AuroraAmazon 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.

Amazon DynamoDBAmazon 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.

Database Replication exam questions

Real practice exam questions on Database Replication, with the correct answer and its explanation. Answer them with every option in the exam simulator.

CLF-C02

A company is migrating an on-premises Microsoft SQL Server database to Amazon Aurora PostgreSQL. The migration must handle engine-specific stored procedures and keep the target data updated while employees continue using the source database. Which plan correctly separates the responsibilities for database code conversion and ongoing data replication?

Show answerCORRECT ANSWER

Use AWS Schema Conversion Tool to convert supported database code and resolve conversion issues. Then use AWS Database Migration Service to load data and replicate ongoing changes.

AWS SCT converts schemas and supported database code between engines, with guidance for items requiring manual changes. AWS DMS can then load existing data and replicate ongoing changes to reduce downtime before cutover.

SOA-C03

A company runs an order-processing application on an Amazon RDS for PostgreSQL DB instance. A reporting application connects to the same DB instance endpoint. During business hours, reporting queries cause high CPU utilization and slow order processing. Performance analysis confirms that the reporting queries account for most of the CPU usage and that storage performance is adequate.

Reports must continue to include newly committed orders throughout the day, but they can tolerate asynchronous replication lag. A CloudOps engineer must move reporting queries to separate database compute resources without replacing or resizing the existing DB instance.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Create an RDS read replica of the existing DB instance. Configure the reporting application to use the replica's endpoint and monitor replication lag.

An RDS for PostgreSQL read replica provides separate compute resources for read-only queries and asynchronously receives changes from the source. Directing reporting connections to the replica offloads reporting work while leaving the existing DB instance in place.

DOP-C02

A company runs a transaction-processing application on an Amazon Aurora PostgreSQL global database with one primary DB cluster and one secondary DB cluster in another AWS Region. Both clusters have provisioned DB instances and use an engine version that supports managed global database failover and recovery point objective enforcement.

During a network impairment, the primary cluster continues acknowledging transactions while cross-Region replication falls several minutes behind. The company requires the database to enforce a maximum cross-Region recovery point objective (RPO) of 60 seconds. If replication cannot maintain this objective, delaying transaction commits in the primary Region is acceptable. Regional recovery will use a managed failover to the existing secondary cluster. The company does not want custom application write-gating logic.

Which change should a DevOps engineer implement?

Show answerCORRECT ANSWER

Configure the primary cluster's rds.global_db_rpo parameter to 60 seconds in its DB cluster parameter group.

Aurora PostgreSQL global databases support RPO enforcement through rds.global_db_rpo. With one secondary Region, Aurora can block primary transaction commits when necessary until that secondary catches up sufficiently to satisfy the configured RPO. This provides database-level enforcement and explicitly trades primary write availability for the required data protection.

Practice Database Replication in a full exam

Questions on Database Replication in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Database Replication

2 min read

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.

Learn Database Replication in lessons

7 short lessons on Database Replication in 4 certification courses.

and 1 more lesson

Open the lessons