logo

Migrating billions of records: moving our active DNS database while it’s in use

ID: 74dd5e2d-1f95-5147-8985-997e38c285b9

STIX ID: report--74dd5e2d-1f95-5147-8985-997e38c285b9

Feed Name: Cloudflare Blog

Date Published: 2024-10-29

Date Updated: 2026-04-27

Author: Alex Fattouche

...
...

Cloudflare describes how it migrated massive DNS datasets (e.g., 1.7B active records and 4.3B archived) from a monolithic Postgres cluster to a dedicated `dnsdb` using a custom Change Data Capture and Transfer Service with triggers, batching, auditing tables, and a gRPC API to control access. The approach enabled an incremental initial copy, sub-second change batching, bidirectional safety, partitioning by zone, and a migration manager that locked writes for just ~2 seconds during cutover. Post-migration, DNS Records API throughput more than doubled, CPU on both clusters stabilized below 10%, latency spikes reduced, and overall database-related incidents dropped, providing greater reliability and headroom for future growth.

Your team is not currently subscribed to this feed. You must subscribe to it in order to see this post.