HarbourBridge

Google's Spanner Migration Tool — core contributor

maintained Core contributor 2022
40–60%
perf gain
Zero-downtime
CDC
10K+
migrations

HarbourBridge is Google's open-source tool for migrating legacy relational databases to Cloud Spanner. It supports schema and data migration from MySQL, PostgreSQL, Oracle, SQL Server, and DynamoDB, handling the complex translation between source-specific SQL dialects and Spanner's distributed relational model. As a core contributor, I architected and built key components:

One of the core challenges HarbourBridge solves is schema translation. Relational databases like MySQL and PostgreSQL use auto-increment primary keys, foreign key constraints, and storage-engine-specific column types that have no direct equivalent in Spanner. HarbourBridge automatically maps source data types to Spanner-compatible types (for example, converting MySQL's ENUM to STRING or PostgreSQL's SERIAL to INT64 with sequence emulation), recommends composite primary keys to replace auto-increment patterns, and identifies parent-child relationships that benefit from Spanner's interleaved table design for co-located storage and efficient joins.

The migration workflow follows an assessment-then-migration pattern. In the assessment phase, HarbourBridge connects to the source database, introspects the schema, and generates a detailed migration report highlighting potential issues: unsupported column types, foreign key relationships that should become interleaved tables, and indexes that need restructuring for Spanner's distributed architecture. Engineers review and adjust the proposed schema mapping before committing to the actual data migration, reducing the risk of costly post-migration schema changes.

HarbourBridge integrates with the broader Spanner ecosystem through Datastream for change data capture, Cloud Pub/Sub for event buffering, and Dataflow (Apache Beam) for scalable data transformation. This pipeline architecture enables minimal-downtime migrations where the bulk data load runs first, followed by continuous CDC replication that keeps the Spanner target synchronized with the source until the final cutover. The tool has supported thousands of production migrations across enterprise customers adopting Spanner for globally distributed, strongly consistent workloads.

Key Highlights

Built with

GoCloud SpannerDatastreamCDCGoogle Cloud

Acknowledgments

Spanner architecture and migration tooling
Change Data Capture infrastructure
Data pipeline orchestration

← All projects