Zero-downtime database migration at scale

Stripe's DocDB moves petabytes across 2,000+ MongoDB shards with 5.5 nines uptime InfoQ
TL;DW
  • Stripe processes 1.4 trillion dollars annually with 5.5 nines reliability across 2,000+ MongoDB shards handling 5M+ queries per second.
  • Zero-downtime data movement platform uses versioned gating: proxy servers annotate requests with routing metadata version; source shard rejects stale versions until coordinator updates routes.
  • Traffic switch from source to target shard takes milliseconds to 2 seconds; all failed reads/writes succeed on client retries without manual intervention.
  • Optimized MongoDB bulk import throughput 10x by sorting data by index attributes before insertion, exploiting B-tree storage engine locality.
  • Bidirectional replication during migration enables fast rollback: writes tagged to prevent cyclical loops; source shard can be safely spun down after handoff.
  • Built DocDB (MongoDB-as-a-service in-house) instead of buying because Stripe requires custom security, reliability, performance, and multi-tenancy controls at financial scale.
  • Horizontal scaling, MongoDB version upgrades (entire 2000+ shard fleet), and single/multi-tenancy migrations all leverage same zero-downtime data movement platform.
  • Routing metadata updates propagate eventually-consistent to hundreds of stateless proxy servers; fencing at primary shard prevents stale proxies from serving old routes.
  • Migrate approximately 1.5–2 terabytes per target shard daily; total migration time depends on data size, index count, and ongoing write throughput on source shard.
  • In-house capabilities justify investment when they drive 3–5 year strategic advantage, require unique reliability/security/compliance controls, or reduce vendor lock-in risk.

Stripe's DocDB platform orchestrates zero-downtime shard splits, merges, version upgrades, and tenant migrations across 2,000+ MongoDB shards handling 5M+ queries per second. Point-in-time snapshots, CDC-based bidirectional replication, and proxy-layer versioned gating switch traffic in milliseconds without disrupting $1.4T in annual payment volume.