Datadog

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

Jun 23, 2026Arnold Wakim
How we migrated a live routing system using AI-assisted refactoring | Datadog
SummaryAI, from the source post

This post details the migration of Datadog's Stream Router from a KV-based storage model (FoundationDB/RocksDB) to a relational schema backed by PostgreSQL (write path) and DuckDB (read path). The migration was driven by the limitations of the KV model in handling complex relationships between routes, sharding strategies, and rules, which led to transaction size limits and performance bottlenecks. The new schema directly models these relationships with foreign keys. The migration process was significantly accelerated using AI-assisted refactoring tools (Claude, Cursor) in a test-driven workflow, where AI generated code based on old implementations, new schemas, and failing tests. The post highlights the benefits of this approach for safely evolving critical production systems, emphasizing the human expertise still required for validation and complex logic.

More from the Data Completeness Measurement trail