Oracle RDS Read Replica with DMS CDC.

Matheus Oliveira
NAZAR
Published in
2 min readJan 23, 2019

--

Even though Read Replica (RR) feature is not natively available for Amazon RDS for Oracle, you can implement it using Database Migration Service (DMS) with change data capture (CDC).

https://docs.aws.amazon.com/pt_br/dms/latest/userguide/CHAP_ReplicationInstance.html

Amazon RDS Read Replicas provide enhanced performance and durability for database (DB) instances. This feature makes it easy to elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads. You can create one or more replicas of a given source DB Instance and serve high-volume application read traffic from multiple copies of your data, thereby increasing aggregate read throughput. Read replicas can also be promoted when needed to become standalone DB instances. Read replicas are available in Amazon RDS for MySQL, MariaDB, and PostgreSQL as well as Amazon Aurora.
https://aws.amazon.com/rds/details/read-replicas

Basically, you will need to setup “Supplemental logging” on your source database and then create a snapshot that will be used for your RR instance creation.
After creating your RR instance from your source database snapshot, you will setup you DMS replication by creating a replication instance, source and target endpoints, and a task.

Create a “Replicate data changes only” task with the “Target table preparation mode” option set to “Do nothing”.

The trick here is to set “CDC start mode” with the “Specify start time” option and specifying the Snapshot Creation Time or setting “CDC start mode” with the “Specify log sequence number” and specifying the SCN of the time of your source database snapshot. By doing this, DMS will be able to replicate every data changed since your source database snapshot, creating your Read Replica instance.

The idea of this post is to explore a different use of the AWS DMS service more than going through every implementation details. Another use of DMS CDC would be creating a disaster recovery plan in different AWS Regions. What other use can you think?

--

--