<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o" -->

---
title: How Datadog Used Claude and Cursor for Test-Driven...
description: Datadog engineer Arnold Wakim details how the team migrated Stream Router, a critical metrics pipeline API, from a key-value FoundationDB backend to PostgreSQL...
canonical: https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How Datadog Used Claude and Cursor for Test-Driven Production Migration | daily.dev
og:description: Datadog engineer Arnold Wakim details how the team migrated Stream Router, a critical metrics pipeline API, from a key-value FoundationDB backend to PostgreSQL...
og:url: https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o
og:image: https://api.daily.dev/og/posts/fkPp9yv7O.png
og:image:alt: How Datadog Used Claude and Cursor for Test-Driven Production Migration
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How Datadog Used Claude and Cursor for Test-Driven Production Migration

**[InfoQ](https://daily.dev/sources/infoq)** · 4 min read · 2 upvotes · 0 comments

## Summary

Datadog engineer Arnold Wakim details how the team migrated Stream Router, a critical metrics pipeline API, from a key-value FoundationDB backend to PostgreSQL using Claude and Cursor in a test-driven workflow. The AI tools were not used autonomously — each method refactor was guided by providing the old implementation, new schema, and a failing test. Three enablers made it work: strong code modularity, a comprehensive test suite, and a parallel blue/green infrastructure with a validator service comparing responses. The migration reduced operation times from 45 minutes to ~1 second, cut latencies from hundreds of milliseconds to a few, shrank data storage by up to 40x, and reduced database costs by 90%. Key limitations included AI's inability to independently discover query optimizations like batching and CTEs, and high token consumption from unfiltered test output dumps.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.infoq.com/news/2026/07/datadog-ai-production-migration>

## Questions this post answers

### How did Datadog use Claude and Cursor to migrate a production system from FoundationDB to PostgreSQL?

Datadog used Claude and Cursor in a test-driven refactoring process, feeding each method the old implementation, the new schema, and a failing test, then letting the models generate a first pass that tests verified as correct. This worked because of strong code modularity, a comprehensive test suite, and a parallel blue/green infrastructure comparing the old and new systems side by side. Operations dropped from 45 minutes to about a second, and database costs fell by 90%.

_See how daily.dev surfaces real-world lessons on AI-assisted production migrations like this one._

### What are the limitations of using Claude for database query optimization?

Claude generated correct but suboptimal SQL queries, missing niche optimizations like batching, UNNEST tricks, and common table expressions on its own, even though these patterns exist in published literature. Engineers had to write the optimized versions themselves; only after seeing the pattern could the model replicate it in later methods, meaning human expertise remained necessary to discover these optimizations first.

_Developers weighing AI code generation against manual query tuning can track findings like this on daily.dev._

### What performance improvements did Datadog get from migrating Stream Router off FoundationDB to PostgreSQL?

The migration reduced the most demanding operations from 45 minutes to about a second, cut latencies from hundreds of milliseconds to a few milliseconds, shrank data storage up to 40x, lowered CPU and memory usage, and reduced database costs by 90%. The improvement came from replacing an in-process relational logic layer built on a key-value store with a properly relational PostgreSQL schema using foreign keys.

_Anyone evaluating a move from key-value to relational storage can follow migration stories like this on daily.dev._

## Similar posts on daily.dev

- [How we migrated a live routing system using AI-assisted refactoring](https://daily.dev/posts/how-we-migrated-a-live-routing-system-using-ai-assisted-refactoring-1lsw1clgt) · Datadog · 3 upvotes · 0 comments
- [How Vercel used Cursor to build Queues · Cursor](https://daily.dev/posts/how-vercel-used-cursor-to-build-queues-cursor-xoeclxyu4) · Cursor · 0 upvotes · 0 comments
- [Cursor vs. Claude for FastAPI Development](https://daily.dev/posts/cursor-vs-claude-for-fastapi-development-crtzplmvs) · TestDriven.io · 21 upvotes · 0 comments
- [How Cursor AI Slashed Dashboard Migration Time 75%](https://daily.dev/posts/how-cursor-ai-slashed-dashboard-migration-time-75--llqac7r1m) · Salesforce Engineering · 49 upvotes · 1 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#claude](https://daily.dev/tags/claude), [#tdd](https://daily.dev/tags/tdd)

[View this post on daily.dev](https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How Datadog Used Claude and Cursor for Test-Driven Production Migration","url":"https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o"},"datePublished":"2026-07-10T08:03:39.419Z","dateModified":"2026-09-14T08:39:43.489Z","description":"Datadog engineer Arnold Wakim details how the team migrated Stream Router, a critical metrics pipeline API, from a key-value FoundationDB backend to PostgreSQL...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d2ed2ca91d9dc393a3cc1ad5d12fa551?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/d2ed2ca91d9dc393a3cc1ad5d12fa551?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"InfoQ","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"InfoQ","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/afc3bced3e1e4b188dd9127017a60e0c","url":"https://daily.dev/sources/infoq"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"database,postgresql,claude,tdd","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"InfoQ","item":"https://daily.dev/sources/infoq"},{"@type":"ListItem","position":3,"name":"How Datadog Used Claude and Cursor for Test-Driven Production Migration"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-datadog-used-claude-and-cursor-for-test-driven-production-migration-fkpp9yv7o#faq","mainEntity":[{"@type":"Question","name":"How did Datadog use Claude and Cursor to migrate a production system from FoundationDB to PostgreSQL?","acceptedAnswer":{"@type":"Answer","text":"Datadog used Claude and Cursor in a test-driven refactoring process, feeding each method the old implementation, the new schema, and a failing test, then letting the models generate a first pass that tests verified as correct. This worked because of strong code modularity, a comprehensive test suite, and a parallel blue/green infrastructure comparing the old and new systems side by side. Operations dropped from 45 minutes to about a second, and database costs fell by 90%. See how daily.dev surfaces real-world lessons on AI-assisted production migrations like this one."}},{"@type":"Question","name":"What are the limitations of using Claude for database query optimization?","acceptedAnswer":{"@type":"Answer","text":"Claude generated correct but suboptimal SQL queries, missing niche optimizations like batching, UNNEST tricks, and common table expressions on its own, even though these patterns exist in published literature. Engineers had to write the optimized versions themselves; only after seeing the pattern could the model replicate it in later methods, meaning human expertise remained necessary to discover these optimizations first. Developers weighing AI code generation against manual query tuning can track findings like this on daily.dev."}},{"@type":"Question","name":"What performance improvements did Datadog get from migrating Stream Router off FoundationDB to PostgreSQL?","acceptedAnswer":{"@type":"Answer","text":"The migration reduced the most demanding operations from 45 minutes to about a second, cut latencies from hundreds of milliseconds to a few milliseconds, shrank data storage up to 40x, lowered CPU and memory usage, and reduced database costs by 90%. The improvement came from replacing an in-process relational logic layer built on a key-value store with a properly relational PostgreSQL schema using foreign keys. Anyone evaluating a move from key-value to relational storage can follow migration stories like this on daily.dev."}}]}
```

