A pharmaceutical research institute is migrating a legacy monolithic clinical trial application from an on-premises data center to Google Cloud. The legacy system relies on an on-premises PostgreSQL database that suffers from technical debt, specifically unnormalized tables accessed directly by multiple legacy modules. The institute must refactor the database into domain-driven data structures and migrate to Cloud SQL for PostgreSQL without introducing downtime or breaking existing regulatory reporting dependencies during the transition period. Which strategy best addresses the technical debt while satisfying the migration constraints?
- Apply the expand-contract pattern by introducing backward-compatible views in PostgreSQL, continuously replicate data to Cloud SQL using Database Migration Service (DMS), and incrementally transition microservices to the new schema before removing legacy structures.Cevap
- BRefactor all unnormalized tables directly into a globally distributed Cloud Spanner database schema, and use continuous CDC replication to sync data prior to a single-cutover migration.
- CPerform a breaking schema refactor directly on the target Cloud SQL database, followed by a blue-green application deployment that immediately redirects all legacy and microservice traffic to the new schema.
- DContainerize the monolithic application, deploy it to a Google Kubernetes Engine (GKE) cluster, and run independent PostgreSQL container pods per microservice using an offline database export and import.
Cevap
Apply the expand-contract pattern by introducing backward-compatible views in PostgreSQL, continuously replicate data to Cloud SQL using Database Migration Service (DMS), and incrementally transition microservices to the new schema before removing legacy structures.
The correct strategy combines the expand-contract database refactoring pattern with continuous replication via Database Migration Service (DMS). Creating backward-compatible views ensures existing legacy reporting applications continue to function without breaking, while microservices are incrementally migrated. Database Migration Service ensures real-time data synchronization between on-premises PostgreSQL and Cloud SQL with minimal downtime.
Adım Adım Çözüm
Anahtar Kavram
Managing Database Technical Debt during Migrations using Expand-Contract Pattern and Database Migration Service