CASE STUDY / PRODUCTION

Near-Zero-Downtime 500 GB PostgreSQL RDS Major Upgrade

Engineering Bucardo-based logical replication to upgrade a ~500 GB Amazon RDS PostgreSQL cluster for Traveloka Flight services with under five minutes of cutover downtime.

Status
Production
Key outcome
<5m — cutover downtime on 500 GB DB
<5mCutover downtime window
~500 GBProduction RDS PostgreSQL dataset
0Data loss across major-version switch
PostgreSQLAWS RDSBucardoGitHub ActionsDatadog

Traveloka (Flight Services) · Production database engineering (Aug 2022 – Dec 2022)

Problem & context

Upgrading a ~500 GB production Amazon RDS PostgreSQL database across major versions using standard in-place engine upgrades or snapshot-restore workflows introduces long maintenance windows—blocking live flight search, booking, and ticketing transactions. For Traveloka Flight services, the engineering requirement was strict: complete the major-version PostgreSQL upgrade while keeping customer-facing cutover downtime under five minutes and preserving a fast rollback path.

Architecture & replication approach

To decouple data migration time from the cutover window, I designed an asynchronous master-to-master logical replication topology using Bucardo between the existing RDS cluster and the target major-version RDS instance:

Zero-downtime database upgrade pipelineAmazon RDS PostgreSQL · ~500 GB dataset
  1. Provision TargetNew RDS major version + schema
  2. Bucardo SyncTrigger-based delta replication
  3. Parity & Lag GateRow-count & Datadog APM checks
  4. Controlled Cutover<5m connection drain & switch
  1. Side-by-side target provisioning: Provisioned the target Amazon RDS PostgreSQL major-version cluster with tuned parameter groups, storage IOPS, and pre-applied schema definitions.
  2. Bucardo replication & backfill: Configured Bucardo trigger-based delta capture on the source cluster alongside initial snapshot seeding so historical and in-flight writes synced continuously without locking production traffic.
  3. Observability & lag verification: Extended Datadog dashboards and monitors across database replication lag, transaction throughput, and Flight service latency, automating build and verification steps with GitHub Actions.
  4. Sub-5-minute cutover: During the maintenance window, paused write traffic briefly, verified zero replication lag and checksum parity, switched application database endpoints to the new RDS cluster, and kept reverse-sync standby ready for instant rollback.

Upgrade strategy trade-offs

Approach Evaluated Operational Risk Why Bucardo Replication Won
In-place RDS major upgrade 30–60+ minutes of hard database unavailability and slow rollback Eliminated long outage: Continuous delta sync decoupled 500 GB data copy from cutover time.
Snapshot restore + downtime Write freeze required for the entire snapshot & restore cycle Sub-5-minute freeze: Only final delta drain and endpoint switch occurred during the maintenance window.
Native logical replication Version constraints on older PostgreSQL source engines Engine-version flexibility: Bucardo bridged older PostgreSQL major versions reliably with bidirectional fallback.

Production outcomes