Migrating our Messages API to Rust
Anthropic migrated its production Messages API from Python to Rust, using the live Python service as an oracle because tests were incomplete and the API kept changing.
Topics Engineering practices
Large refactors, codebase migrations, legacy modernization, tech debt.
Search within Refactoring & migrations, or combine it with other topics →
Anthropic migrated its production Messages API from Python to Rust, using the live Python service as an oracle because tests were incomplete and the API kept changing.
Country Road Group replaced 21 BizTalk Server interfaces on VMware with a declarative, pattern-driven integration platform on AWS, where each interface is composed from standard enterprise integration patterns provisioned by pre-built Terraform modules.
Vinted migrated all 300+ product screens of its 15-year-old Android app from XML Views to Jetpack Compose in 18 months while feature work continued.
Thirty engineers rebuilt the 300+ screen Shopify mobile app from React Native to native Swift and Kotlin in 12 weeks, with agents writing most of the code.
Yelp moved roughly 1000 Cassandra pods and nearly a petabyte of data from self-managed Kubernetes clusters to Amazon EKS without streaming any data.
Upgrading Databricks Runtime from 14.3 (Python 3.10) to 17.3 (Python 3.12) broke loading of registered MLflow models, because cloudpickle embeds Python bytecode that the newer interpreter can't parse.
gopls now supports interactive refactoring through a proposed Language Server Protocol extension, co-designed with the Dart team, that lets language servers ask the user for input before computing edits.
Jane Street replaced its per-host PowerShell config management for Windows, which evaluated JSON meta-configs locally for applicability, scheduling and phased rollout, with a centralized design.
GitHub migrated its Primer Design System and the github.com codebase from styled-components CSS-in-JS to CSS Modules, removing runtime styling costs on client and server.
Helix is Shopify's internal LLM tooling for rebuilding its 300+ screen React Native app in native Swift and Kotlin.
Shopify rebuilt the Shop app from React Native into native Swift/SwiftUI and Kotlin/Jetpack Compose in 12 weeks, with coding agents porting features using the existing React Native app as a reference.
Shopify is moving its mobile apps from React Native back to native Swift and Kotlin because coding agents have cut the cost of building and keeping features in parity across two platforms, while native still gives closer access to platform capabilities and first-party tooling.
Doximity migrated its server-driven iOS Newsfeed from UIKit to SwiftUI incrementally, using The Composable Architecture's separation of state from views as the migration boundary.
Linear migrated its React apps from styled-components to Meta's StyleX over more than 1,000 PRs.
Yelp migrated 1.4 million lines of Flow-typed JavaScript in a Lerna monorepo to TypeScript over three and a half years, converting one package at a time without ever bulk-disabling typechecking.
The OpenTelemetry Collector's Datadog receiver lets existing Datadog agents and SDKs send logs, traces and metrics to a Collector.
Shopify's Checkout Blocks team migrated five high-traffic checkout UI extensions from React and the legacy Remote UI bridge to Preact, remote-dom and Polaris web components, rewriting them in TypeScript, and cut transferred bundle sizes by 40-85% and extension load time by about 8% at P50.
Yelp replaced the deprecated apollo-tooling codegen with GraphQL Codegen across a 500+ package React/TypeScript monorepo without requiring developers to change imports or queries.
Bun, a 535k-line Zig JavaScript runtime, was mechanically ported to Rust over 11 days using about 50 continuously running Claude Code workflows.
ScarfBench is an open benchmark of 34 enterprise Java applications (102 implementations, 204 migration tasks, ~151K LOC, 1,331 expert-written tests) for evaluating AI agents on migrations between Spring, Jakarta EE and Quarkus, scored on whether the result builds, deploys and preserves behavior.
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.
Apple rewrote the TrueType font hinting bytecode interpreter from C to memory-safe Swift for its Fall 2025 OS releases.
With Lightstep sunsetting, Zalando built and open-sourced a Go translator that deterministically converts Lightstep UQL queries into PromQL.
Booking.com applied Kotlin Multiplatform in two production cases: a shared experimentation library replacing drifting Java/Kotlin and Objective-C implementations, and a Compose Multiplatform (Kotlin/JS) web playground that renders the real Android BUI design-system components in a browser.
SemVer range prefixes like ^, ~ and wildcards in package.json act as a trust policy that lets compromised or hijacked packages flow into CI and production on the next install.
Yelp moved its JavaScript monorepo builds from Webpack to Rspack and cut integration build time by about 52% on average.
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.
Slack replaced 700+ SSH-based Airflow operators that ran jobs directly on EMR master nodes with REST-based submission through Quarry, its internal job gateway.
Meta escaped a long-diverged internal WebRTC fork by statically linking two WebRTC versions into one binary behind a version-agnostic shim layer, which let it A/B test legacy and upstream stacks app-by-app across 50+ use cases.
Railway migrated its entire production frontend (dashboard, canvas, marketing site, 200+ routes) from the Next.js Pages Router to Vite + TanStack Router/Start in two PRs with zero downtime.
Etsy moved shard routing for its ~1,000-table, ~1,000-shard, 425 TB MySQL cluster (1.7M requests/sec) from an ORM that looked up random shard mappings in a single index database to Vitess vindexes, without moving any data.
Figma replaced its decade-old Instance Updater, a self-contained runtime that resolved component instances and also did its own layout and variable evaluation, with Materializer, a generic framework for deriving subtrees of the document tree from feature-defined blueprints.
Wealthfront replaced its checked-in .xcodeproj with XcodeGen-generated projects defined in YAML, which eliminated project-file merge conflicts across seven squads and made build configuration reviewable in pull requests.
Benchling replaced M×N hand-built integrations between scientific object types (DNA sequences, notebook entries, inventory) and platform capabilities (REST API, warehouse, search, config migration) with the Object Framework, a spec-first layer over its monolithic SQLAlchemy-based service.
Vinted's Android team migrated a codebase of several hundred Gradle modules from Dagger, dagger.android and Anvil to Metro, a Kotlin compiler-plugin DI framework, mainly to escape Anvil's K1 lock-in and enable K2 and incremental compilation.
Artsy's React Native apps (Eigen, Folio, Palette Mobile) adopted Expo and over-the-air updates after VS App Center's retirement, and all three moved to the new architecture.
ClickHouse, a 1.5M-line C++ analytic database, is adopting Rust incrementally rather than rewriting.
Meta wraps risky OS and third-party APIs in secure-by-default frameworks built on three principles: mirror the existing API, depend only on public and stable interfaces, and keep each library small but usable across all apps and OS versions.
Zed's new Settings Editor required replacing its distributed, runtime-registered settings model, where each crate declared its own settings, with centralized strongly typed `UserSettings` and `ProjectSettings` structures that map directly to configuration files.
Microsoft's Entra SDK v1-to-v2 migration across hundreds of repositories succeeded with an AI coding agent only after the team replaced step-by-step checklists with prompts that give the agent a role, mission and permission to use judgment.
Kogan.com is shifting its Django APIs from Django REST Framework's serializers, viewsets and routers to Django Ninja with Pydantic schemas, defining each endpoint as a type-hinted function with separate input Schema and output ModelSchema classes.
Slack cut the 60-minute build pipeline for Quip and Slack Canvas's backend by applying classic software engineering principles (hermetic, idempotent, granular units of work and clean separation of concerns) before adopting Bazel.
Upgrading Medium's Android app from Apollo Kotlin 3 to 4 surfaced CacheMissException errors across every watch()-based UI, because v4 delivers fetch errors through ApolloResponse instead of throwing or silently dropping them.
Zalando is incrementally migrating its separate iOS and Android apps to React Native by reusing Rendering Engine, its React-based web framework whose "renderers" bundle data fetching, caching, observability and tracking into components.
Shopify moved Shopify Mobile and POS to React Native's New Architecture (Fabric) without pausing weekly releases.
Meta's Federation Platform turns large compliance initiatives into code-defined workstreams that scrape privacy flags, resolve asset ownership via a central catalog, group related flags, and either file tasks or send automated diffs, with resolution logic that auto-closes or reopens tasks.
Bringing Canva's editor draw tool into present mode required three fixes: extracting the editor-coupled draw logic into a new shared package with interfaces between shared classes and domain-specific implementations (Open/Closed Principle), normalizing stroke coordinates so drawings stay correctly positioned and scaled across Presenter View's presenter and audience windows, and lazy loading the draw tool with code splitting.
Figma replaced the separate architectures behind component properties (scoped, layer-level parameters) and variables (global, library-level parameters) with one parametrization system.
Current coding assistants such as Gemini 2.5 Pro and Claude 3.7 act as strong tactical programmers in Ousterhout's sense: they implement what is asked quickly but take the path of least resistance and let complexity and duplication grow.
Shopify migrated its Admin (67 million daily page views, 101 teams, ~350 PRs merged daily, 3M+ lines of TypeScript) to Remix in SPA mode with Vite.
Datadog is splitting its large shared Postgres database into independently owned instances through a three-phase plan: logical separation into per-domain private schemas with explicit ACLs, access reduction so only owning teams query their tables directly, and physical separation onto managed OrgStore instances.
GitHub rebuilt Issues search to support AND/OR operators and nested parentheses by replacing the flat-list parser with a PEG grammar (via the Ruby parslet library) that produces an abstract syntax tree.
Datadog rewrote its AWS Lambda Extension from a Go build of the full Datadog Agent into a purpose-built Rust sidecar (Project Bottlecap), cutting cold start overhead from about 450 ms to 70 ms, memory from 128 MiB to 77 MiB, and binary size from 55 MB to 7 MB.
Klarna split each payment option (pay now, pay later, pay over time) into its own microservice, but shared logic such as authentication, funding sources and risk assessment produced a distributed monolith full of duplicated code and cross-team coordination.
Zalando's Partner Tech team migrated 15 B2B applications between two in-house UI component libraries using GPT-4o, after five hackathon iterations showed that accuracy came from combining generated component interfaces, manually verified attribute mappings (e.g. old "medium" button maps to new "large") and worked examples in the prompt.
Etsy adopted Jetpack Compose as its preferred Android UI toolkit through a staged rollout.
Zalando's Lightstep Receiver for the OpenTelemetry Collector accepts trace traffic from legacy Lightstep tracers and converts it into OpenTelemetry traces, so applications can join an OpenTelemetry pipeline without being re-instrumented.
Meta is translating roughly ten million lines of Android Java to Kotlin using the Kotlinator, an automated pipeline built around a headless version of JetBrains' J2K.
Slack built a conversion tool to move 242 Jenkins pipelines to GitHub Actions by layering corrections on top of GitHub's Actions Importer, which fully converted about 50% of pipelines, partially converted 45% and failed on 5%.
Facebook spent roughly two years unifying its separate Watch and Reels stacks across mobile clients, the server layer and ranking, in a deliberate order.
Migrating a CommonJS codebase to ECMAScript modules means replacing require/module.exports with import/export and using fully specified paths that include file extensions.
Indeed migrated thousands of engineers and over 2,000 Jenkinsfiles from Jenkins to GitLab CI before its CloudBees license expired on April 1, 2024.
Slack re-architected its backend and clients to replace the workspace-centric model, where session tokens carried a workspace ID used for shard routing and access control, with an org-wide Unified Grid view for Enterprise Grid customers.
Slack migrated 60+ EMR clusters serving 40+ teams from EMR 5 (Spark 2.4/Hive 2) to EMR 6 with Spark 3 as the single compute engine.
Mixing SwiftUI into Medium's 2013-era UIKit iOS app brings recurring friction: sizing SwiftUI views hosted in UIHostingController as table/collection cells, mismatched scroll APIs (offset sign differs), and duplicated components like PostPreview implemented in both frameworks.
ClickHouse is rewriting its Java client as client-v2, an early alpha shipped in version 0.6.1+, to fix V1's heavy boilerplate, error-prone manual RowBinary serialization and unsafe defaults such as response object reuse.
Datadog rewrote the Codiga static analyzer from Java to Rust after switching its parser from ANTLR to Tree-sitter, whose Java bindings lacked features like pattern matching.
Slack converted over 15,000 Enzyme tests to React Testing Library ahead of its React 18 upgrade by combining AST codemods with an LLM (Claude 2.1).
ClickHouse rebuilt its Cloud Console by merging a legacy Angular control plane and a React SQL console (from the Arctype acquisition) into a single React app, backed by a token-driven design pipeline.
Figma migrated its prototype viewer's mobile engine from Skew, an in-house compile-to-JavaScript language, to TypeScript using a custom Skew-to-TypeScript transpiler and a three-phase rollout (write/build Skew, write Skew/build TypeScript, write/build TypeScript) that never paused development.
Firefox's crash reporter was rewritten in Rust, replacing three separate native GUI implementations (Win32, GTK, macOS) and their C++/Objective-C glue, which had no test suite, with a small custom UI abstraction.
Etsy rewrote its 4000-line Android listing Fragment into Macramé, a Mobius-inspired unidirectional architecture: a single immutable State exposed via StateFlow, flattened into small UI models rendered by a RecyclerView with ListAdapter diffing, and a sealed-class Event dispatcher routing actions to single-purpose Handlers that update State, launch async work, or emit SideEffects to the Fragment.
Etsy rebuilt its mobile Updates tab as a new Deals tab in SwiftUI inside a modular Tuist module, which made preview builds nearly instant and let the team build modules from mock preview data about two weeks before the APIs were ready.
Packwerk, Shopify's static analysis gem for enforcing package boundaries in Rails monoliths via constant references, works best as a dependency-graph tool rather than an API-privacy tool, which is why privacy checks were removed in 3.0.
Zed rewrote its Rust UI framework from GPUI 1 to GPUI 2 because the original design blocked fast UI work: a Flutter-style constraints-down/sizes-up layout model, styles split between Rust element code and TypeScript-generated JSON "themes" loaded at runtime, model code entangled with presentation (a legacy of an early Electron/JSON architecture), and weakly typed geometry (raw f32s and usizes).
Zalando's Search & Browse team moved their multi-cluster Elasticsearch deployment from 7.17 to 8.x, mainly to get approximate kNN vector search.
Zed is rewriting its UI framework as GPUI 2 and porting the whole editor onto it before open-sourcing, trading feature work for better ergonomics while keeping GPUI 1's performance.
Meta's SCARF framework includes a subsystem that finds and deletes unused classes of data, such as tables, storage use cases and TAO object types, across 21 data systems.
Heroku is replacing Hermes, its decade-old Erlang Common Runtime router, with Router 2.0 written in Go.
Meta's SCARF framework finds dead code by building a cross-language, symbol-level dependency graph from Glean and augmenting it with runtime usage data such as API endpoint logs, URI dispatch tables and async job invocations, then garbage-collects unreachable nodes, subgraphs and cycles.
SCARF (Systematic Code and Asset Removal Framework) is Meta's tooling for deprecating products by removing dead code and unused data, credited with deleting over 100M lines of code in five years and petabytes of data across 12.8M data types in 21 systems in one year.
Fixit 2 is a partial rewrite of Meta's open-source Python auto-fixing linter, built on LibCST so rules can safely suggest and apply code replacements without regex or broken syntax.
Railway replaced twin.macro with vanilla Tailwind across 400+ React components, which removed the last dependency on Babel and let the monorepo move fully to SWC.
GitHub's ~2M-line Rails monolith upgrades to the latest Rails main-branch commit every week via a scheduled GitHub Actions workflow that opens an automated PR, runs all builds, and ships the next day.
Shopify's Point of Sale React Native app moved from vanilla Redux to Redux Toolkit over about three months.
Railway rewrote its Go/Cobra CLI in Rust for v3 because the old codebase had untyped, string-defined GraphQL queries, dynamically registered flags that forced ~120 error guards, and assumptions predating multi-service projects.
Monkey patching Rails and other gems is brittle and should be avoided.
Slack migrated its 400+ module Android codebase to non-transitive R classes, where each module's R class contains only its own resources, yielding ~14% faster incremental builds after resource or layout changes and an ~8.5% (about 5.5MB) APK/DEX size reduction.
Meta migrated its exabyte-scale analytics logging platform from legacy Hive Text Delimited and JSON serialization to the Tulip format across more than 30,000 logging schemas, sharply cutting bytes logged per second while schema counts stayed flat.
Shopify rewrote its CLI from Ruby to TypeScript on Node to reduce system requirements, unify the Theme, App and Hydrogen workflows, and stay easy for internal teams to contribute to.
Shopify is moving its largest native app, Shopify Mobile (300 screens per platform), to React Native through "Iterative Porting" rather than a rewrite.
Moving the Accessibility Insights for Web extension from Manifest V2 to V3 meant replacing persistent background pages with service workers that can shut down when idle.
Shopify replaced Ruby's Marshal with MessagePack as the Rails cache format for its core monolith so that code changes would stop breaking cached payloads on deploy.
Meta has converted its Android codebase to over 10 million lines of Kotlin by wrapping JetBrains' J2K converter in an automated pipeline called Kotlinator.
Engineers can safely change unfamiliar code with minimal reading by letting the compiler, linter and unit tests guide them: locate the entrypoint via user-visible strings (or git bisect for regressions), make the breaking change at the leaf component, then climb the callstack following build errors and sweep back down via lint errors, exhaustive switches and test failures.
Contentsquare replaced 14 Elasticsearch clusters with ClickHouse over a phased migration.