What is GCP Database Migration Service (DMS) and how it works!

Virinchi T
Fournine Cloud
Published in
3 min readMar 14, 2024

--

Introduction

For businesses transitioning their workloads to the cloud, transferring on-premises and other cloud-based databases to Google Cloud can often present significant challenges, impeding their ability to leverage Google Cloud’s capabilities promptly.

The Database Migration Service simplifies the process of transferring your data to Google Cloud. It enables the seamless migration of MySQL, oracle and PostgreSQL workloads to Cloud SQL and AlloyDB for PostgreSQL, as well as the modernization of Oracle workloads to Cloud SQL for PostgreSQL.

This service streamlines networking workflows, handles the initial snapshot and ongoing replication, and provides real-time updates on the migration process.

Concepts of Migrations

Migration is a process whereby data and metadata is moved from a source database to a destination database. After the migration is completed, the destination database becomes the primary database, dependent applications should read and write to it, and the source database can be shut down.

Continuous (sometimes referred to as ongoing or online) migration is a continuous flow of changes from your source to your destination that follows an initial full dump and load. In the case of a migration, when the time comes to switch to use the destination for reads and writes, finalize the migration. As a result, replication is finalized between the source and the destination, and the destination Cloud SQL instance or AlloyDB cluster is ready to be used as a stand-alone primary instance. Doing the switch when the source and destination are in sync gives you minimal downtime.

Types of Migration

Homogeneous migrations

For homogenous, like-to-like migrations, such as MySQL to Cloud SQL for MySQL, PostgreSQL to Cloud SQL for PostgreSQL or AlloyDB for PostgreSQL, the migration leverages the primary-replica relationships enabled by native tooling for MySQL and PostgreSQL. This means:

  • When setting up a migration, a replica instance appears in the Cloud SQL instance or AlloyDB clusters list, attached to the source that was set up.
  • When performing a promotion, the replica disconnects from the source and is modified to read/write mode. It can then serve as a primary for other replicas, and other options can be changed such as the HA setting (Cloud SQL only).

Heterogeneous migrations

For heterogeneous migrations where the source and destination are different, such as Oracle to Cloud SQL for PostgreSQL, the migration leverages CDC-based replication.

Use cases

Database Migration Service offers a range of migration capabilities to suit different needs:

  1. Lift and Shift Migration to Managed Services: During an organization’s transition to Google Cloud, Database Migration Service facilitates the migration from VM-based self-hosted databases to managed database cloud services. This shift allows teams to divest from infrastructure management responsibilities and instead benefit from the advantages of managed services, including enhanced availability, robust disaster recovery features, and optimized performance.
  2. Multi-cloud Continuous Replication: In scenarios where data is spread across multiple cloud providers, Database Migration Service supports continuous replication of databases into Google Cloud. This setup enables multi-cloud read-availability akin to read replicas across different regions. However, it’s important to note that Database Migration Service doesn’t facilitate dual-write operations, meaning it doesn’t support simultaneous writing to and reading from both the source and destination databases.

Primary components of DMS

  1. Connection profiles: These contain connectivity details to the designated source for migration tasks.
  2. Conversion workspaces: Utilized for heterogeneous migrations, these workspaces aid in converting schema and code objects from the source database into a compatible format for the destination instance.
  3. Migration jobs: These encompass a source connection profile paired with a destination Cloud SQL instance or AlloyDB cluster, along with migration-specific configurations.

Let me know if you would like to know more about a specific use case.

--

--