Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Wix Engineering 9 min read Case study mediumAdept

5 Billion Records, 10 Terabytes, Four Weeks: A Real Data Migration Playbook

Wix's large live-system migrations dropped from months or years to weeks mainly by tackling recurring problems before the migration starts, not through new tooling. Profile the source database first with a read-only dry run to find corrupt legacy records. Find V1/V2 parity gaps early using E2E suites through the API proxy, LLM analysis of production traffic and shadow compare mode. Decide up front how CDC/Kafka handles a failing record: blocking retries, skip-and-log, or a dead letter queue. Size Kafka partitions and database capacity so eager migration outruns the incoming change rate; contacts needed 350 partitions for 100,000 RPM plus sharding a 14 TB single-master MySQL into eight shards.

Assumes: Change data captureKafka partitionsAPI proxy/shadow traffic

Related posts

  • Migrating Data Ingestion Systems at Meta Scale

    Meta Engineering mediumAdept

    Meta migrated tens of thousands of MySQL-to-warehouse change data capture (CDC) ingestion jobs, together moving several petabytes daily, from customer-owned pipelines to a self-managed warehouse service, and fully retired the legacy system. Each job went through shadow, reverse-shadow and cleanup phases, with promotion gated on matching row counts and checksums plus no regression in landing latency or resource use. Because CDC carries bad data forward into new partitions, bad partitions were flagged in metadata to halt delta landing or fall back to older target partitions, and backfills gave early rollback signals. Automated promotion/demotion tooling, batch selection that excluded jobs with known issues, and reuse of legacy snapshots cut expensive full dumps under limited capacity.

  • How we migrated a live routing system using AI-assisted refactoring

    Datadog Engineering mediumAdept

    Datadog migrated Stream Router, the control plane that tells metrics producers and queriers which Kafka cluster, topic and partitions to use, from a FoundationDB key-value model to a relational schema. PostgreSQL backs the write path and DuckDB the in-memory read path. The KV model forced the app to rebuild relationships in-process and hit transaction size limits, and simply swapping in Postgres with the same access patterns was estimated at 45 minutes for the heaviest operations. The team designed the schema by hand, then used Claude and Cursor in a tightly scoped, test-driven loop: map the intent of the old code into markdown docs, stub one Controller method, feed in the failing end-to-end tests, and iterate until they pass. A blue/green validator compared live responses every 30 seconds for weeks before cutover. The models produced correct but suboptimal SQL, so batching, UNNEST and CTE optimizations needed human input, and broad prompts performed poorly. The project went from design to production in about 3 months.

  • Taking the fear out of migrations

    incident.io mediumAdept

    Data model migrations can be made low-risk with a four-step playbook: create the new model, dual-write to old and new (backfilling dependent and existing data with rerunnable jobs), read from both and alert on mismatches before switching reads behind a feature flag, then stop writing to and drop the old model. incident.io walks through the pattern using its move from hard-coded string incident statuses to a per-organisation incident_statuses table. Every step before dropping the old writes is reversible, so nothing has to be rushed and the read cutover can be undone with a feature flag. Simple migrations still finish in half a day to a day, and the work can be split across several engineers once the schema exists.

  • Partitioning GitHub’s relational databases to handle scale

    GitHub Engineering mediumAdept

    GitHub split its monolithic `mysql1` MySQL cluster by first virtually partitioning tables into schema domains (declared in YAML) and enforcing boundaries with query and transaction linters, then physically moving domains to new clusters via Vitess vertical sharding or a custom ProxySQL/GTID-based write-cutover script. Cross-domain joins were eliminated with techniques like preload, Rails' new `disable_joins` option and application-side joins, validated with Scientist experiments. The write-cutover moved 130 of the busiest tables in tens of milliseconds with only a handful of failed writes. Query volume grew from 950k to 1.2M queries/s while average per-host load halved, reducing database-related incidents.

  • We stopped a Railway migration 3 weeks out. How to know to stop or go?

    Evil Martians mediumAdept

    Evil Martians called off a high-load Rails migration from Engine Yard to Railway three weeks before cutover because Railway's mid-transition hardware fleet made database import times unpredictable: the same MySQL dump took 71 minutes on a GCP burst VM, 97 on Gen 2 AMD EPYC Metal, and 382 on Gen 1 Intel Xeon Metal, so a 3-4 hour maintenance window could not be guaranteed. Beyond the hardware lottery, Railway's production gaps include a fixed 3,000 read/write IOPS cap per volume, PITR and HA only for PostgreSQL (HA as a seven-container Patroni template), no native log drains, a 500 lines/sec log cap with observed log loss, no post-deploy health monitoring or automatic rollback, and downtime on volume-backed redeploys. A seven-question checklist covers tail-latency tolerance, RPO/RTO per datastore, substitute costs for missing managed services, off-platform observability, late-crash recovery, growth-related instability, and exit cost before adopting any cheap, fast-growing PaaS.

The quest for software engineering knowledge.

Look:
Layout: