# Rust Backends, Part 1: Why Rust, and What Anthropic's Migration Shows

> Why teams pick Rust for backends, what Anthropic got from moving its Messages API to Rust, how Rust compares to Go, Node.js, Python and Java, and the costs.

Source: https://bytevancer.com/blog/rust-backends-part-1-why-rust-anthropic-migration · Published 2026-11-26 · ByteVancer · Backend Engineering

**Anthropic migrated its Messages API, the API behind Claude, to Rust and cut CPU per request by about 70%. Why teams pick Rust for backends, how it compares, and what it costs.**

> **Part 1 of 2: Rust Backends** — **Part 1: Why Rust, and what Anthropic's migration shows (you're here)** · [Part 2: How we build and migrate a backend in Rust](https://bytevancer.com/blog/rust-backends-part-2-how-we-build-migrate)

On November 25, 2026 Anthropic published how it migrated its Messages API, the API behind Claude, Claude Code and Cowork, to Rust. It is a detailed public account of a large backend rewrite, so this series uses it as the anchor. Part 1 covers why teams pick Rust for a backend and what Anthropic got. Part 2 is how we build and migrate one. Every figure comes from the sources at the bottom.

## TL;DR

- Rust has no garbage collector, its ownership model guarantees memory safety, and many concurrency errors become compile-time errors.
- Anthropic's Rust Messages API uses about 70% less CPU per request, and median time to first token fell about 20%.
- Its first, smaller step, moving only output parsing to Rust, saved just 8–10% CPU. The full rewrite is what paid.
- Memory-safety bugs were about 70% of Microsoft's CVEs (2019). In Android their share fell from 76% to 24% as Google moved to memory-safe languages.
- The costs are real: slow compiles, a learning curve and, on our reading of Stack Overflow's 2025 usage figures, fewer Rust developers to hire.

## What Anthropic did, and why

Anthropic built the Messages API in Python in 2023. From early 2024 to fall 2026 its traffic grew about 1,800 times. In March 2026 the team tried the gentle route: keep Python and let Rust parse the model's output. CPU fell only 8–10%, because each token crossed the Python–Rust boundary three times. So they went further. In the new design Python hands the request over and Rust does everything around the model. Public traffic moved in September 2026.

Anthropic says Claude wrote the first core request path in about a week, and more than 80% of the merged code by May 2026. The hard part was proving the new API behaved exactly like the old one. In their words: "Verification, not generation, had become the bottleneck." Part 2 covers how they checked it.

**Anthropic's reported results**
- **~70% less** CPU per request — Rust vs the Python API
- **~20% lower** Median time to first token — what users feel as speed
- **>80% less** Memory per request — per Anthropic's charts, Aug to Oct 2026
- **~1,800x** Traffic growth — early 2024 to fall 2026

*From Anthropic's post of Nov 25, 2026.*

## Why teams pick Rust for a backend

- **No garbage collector: **rust-lang.org calls Rust "blazingly fast and memory-efficient: with no runtime or garbage collector". No collector means no collector pauses.
- **Memory safety anyway: **the Rust Book says ownership "enables Rust to make memory safety guarantees without needing a garbage collector".
- **Concurrency bugs at compile time: **"many concurrency errors are compile-time errors in Rust rather than runtime errors". A server runs many requests at once, which is where those bugs hide.
- **Abstractions that cost nothing: **in the Book's benchmark, a hand-written loop ran at 19,620,300 ns per iteration and the iterator version at 19,234,900 — the high-level version was no slower.
- **One tool: **Cargo handles dependencies, builds and packages from crates.io.

## Memory safety is a security number

In 2019 Microsoft's security team said about 70% of the vulnerabilities it assigns a CVE each year are memory-safety issues. In 2024 Google reported that memory-safety bugs fell from 76% of Android vulnerabilities in 2019 to 24% in 2024, a drop it ties to the shift to memory-safe languages. US agencies push the same way: CISA's 2023 "The Case for Memory Safe Roadmaps" and a 2025 CISA and NSA guide to memory-safe languages.

To be fair, Go, Java, Python and Node.js already manage memory for you with a garbage collector or runtime. Rust's pitch against them is safety without that runtime cost. Against C and C++, it is safety itself.

## Other teams running Rust in production

- **Discord (2020): **Go forced a garbage collection at least every 2 minutes, which caused latency spikes. The Rust version "had no latency spikes", and "Latency, CPU, and memory were all better in the Rust version." Fair context: that was Go in 2020. Go's guide says today's collector is "not fully stop-the-world and does most of its work concurrently".
- **Cloudflare Pingora (2022): **a Rust proxy serving more than 1 trillion requests a day, with about 70% less CPU and 67% less memory than Cloudflare's old service at the same load. For one major customer, connection reuse rose from 87.1% to 99.92%: 160x fewer new connections.
- **AWS Firecracker (built in Rust from the start): **the microVM manager boots in under 125 ms, adds under 5 MiB per VM and starts up to 150 microVMs per second per host.

## Rust vs Go, Node.js, Python and Java

**Middle column from the Rust, Go, Node.js and Python docs; the right column is our view.**
- **Rust** — What the docs say: No runtime or garbage collector; many concurrency errors caught at compile time; Our take for backends: Hot paths, high-traffic and latency-sensitive services
- **Go** — What the docs say: Garbage collector that does most of its work concurrently; Our take for backends: Fine for most network services; profile before switching
- **Node.js** — What the docs say: One event loop plus a pool of k Workers; don't block the loop; Our take for backends: Good for I/O-heavy APIs; move CPU-heavy pieces out
- **Python** — What the docs say: The GIL runs one thread's bytecode at a time; since 3.13 it can be disabled with a free-threaded build; Our take for backends: Good for most product APIs; hot loops are where Rust helps
- **Java** — What the docs say: Not compared here: no Java source in this post; Our take for backends: Mature for large services; no figures compared here

## The honest downsides

- **Slow builds: **in Rust's 2025 compiler survey (more than 3,700 responses), about 45% of former Rust users cite long compile times, 55% wait over 10 seconds for a rebuild, and average satisfaction is 6 out of 10.
- **A learning curve: **at Google, more than two thirds of developers felt confident contributing within two months. A third felt as productive within two months, over half within four. Slow builds were the top challenge; on the upside, 85% were confident their Rust code is correct.
- **A smaller talent pool: **Stack Overflow's 2025 survey ranks Rust most admired at 72%, but only 14.8% of respondents use it, against 57.9% for Python, 66% for JavaScript and 16.4% for Go. Our inference: fewer experienced Rust developers, so plan for training.

So Rust earns its place when a backend is hot: high traffic, CPU-bound, latency-sensitive or security-critical. [Part 2](https://bytevancer.com/blog/rust-backends-part-2-how-we-build-migrate) covers how we build one, how we'd migrate yours, and when we'd tell you not to.

## The whole series

1. **Part 1: Why Rust, and what Anthropic's migration shows (this post)**
2. [Part 2: How we build and migrate a backend in Rust](https://bytevancer.com/blog/rust-backends-part-2-how-we-build-migrate)

## Frequently asked questions

**Why did Anthropic move its Messages API to Rust?**
Traffic grew about 1,800 times from early 2024 to fall 2026. A first step that moved only output parsing to Rust cut CPU just 8–10%, because each token crossed Python and Rust three times, so the team rewrote the request path in Rust. It uses about 70% less CPU per request.

**Is Rust faster than Go for backends?**
It depends on the workload. Discord's 2020 Go service had garbage-collection latency spikes the Rust version did not, but Go's guide says its collector now does most of its work concurrently. Measure your own hot path before switching.

**Is Rust memory-safe?**
rust-lang.org says Rust's type system and ownership model guarantee memory safety and thread safety, and it does this without a garbage collector.

## Keep reading

- [Rust Backends, Part 2: How We Build and Migrate a Backend in Rust](https://bytevancer.com/blog/rust-backends-part-2-how-we-build-migrate) — Our Rust backend stack (Tokio, axum, SQLx, Serde), piece-by-piece migration with PyO3 or NAPI-RS vs a full rewrite, shadow-traffic checks, and when to skip Rust.
- [All ByteVancer engineering articles](https://bytevancer.com/blog)

## Thinking about Rust for your backend?

We build custom backends in Rust, Node.js, Python and .NET, and we'll tell you which one your workload actually needs. See our [custom backend development in Rust](https://bytevancer.com/services/custom-software-development) or [talk to the team](https://bytevancer.com/contact).

## Sources

- [Anthropic — Migrating our Messages API to Rust (Nov 25, 2026); some figures from its charts](https://www.anthropic.com/research/migrating-api-to-rust)
- [Rust — official site](https://www.rust-lang.org/)
- [The Rust Book — Understanding ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html)
- [The Rust Book — Concurrency](https://doc.rust-lang.org/book/ch16-00-concurrency.html)
- [The Rust Book — Performance: loops vs. iterators](https://doc.rust-lang.org/book/ch13-04-performance.html)
- [The Cargo Book](https://doc.rust-lang.org/cargo/)
- [Microsoft MSRC — A proactive approach to more secure code (Jul 16, 2019)](https://www.microsoft.com/en-us/msrc/blog/2019/07/a-proactive-approach-to-more-secure-code)
- [Google Security Blog — Eliminating memory safety vulnerabilities in Android (Sep 25, 2024)](https://security.googleblog.com/2024/09/eliminating-memory-safety-vulnerabilities-Android.html)
- [CISA — The Case for Memory Safe Roadmaps (Dec 6, 2023)](https://www.cisa.gov/resources-tools/resources/case-memory-safe-roadmaps)
- [CISA and NSA — Memory Safe Languages guide (Jun 24, 2025)](https://www.cisa.gov/resources-tools/resources/memory-safe-languages-reducing-vulnerabilities-modern-software-development)
- [Jesse Howarth — Why Discord is switching from Go to Rust, Discord blog (Feb 4, 2020)](https://discord.com/blog/why-discord-is-switching-from-go-to-rust)
- [Go — A Guide to the Go Garbage Collector](https://go.dev/doc/gc-guide)
- [Cloudflare — How we built Pingora (Sep 14, 2022)](https://blog.cloudflare.com/how-we-built-pingora-the-proxy-that-connects-cloudflare-to-the-internet/)
- [Firecracker — official site](https://firecracker-microvm.github.io/)
- [Node.js — Don't Block the Event Loop](https://nodejs.org/en/learn/asynchronous-work/dont-block-the-event-loop)
- [Python docs — Glossary (GIL, free threading)](https://docs.python.org/3/glossary.html)
- [Rust Blog — Rust compiler performance survey 2025 results (Sep 10, 2025)](https://blog.rust-lang.org/2025/09/10/rust-compiler-performance-survey-2025-results/)
- [Google Open Source Blog — Rust fact vs. fiction: 5 insights from Google's Rust journey in 2022 (Jun 27, 2023)](https://opensource.googleblog.com/2023/06/rust-fact-vs-fiction-5-insights-from-googles-rust-journey-2022.html)
- [Stack Overflow Developer Survey 2025 — Technology](https://survey.stackoverflow.co/2025/technology)

---

*This is the Markdown copy of https://bytevancer.com/blog/rust-backends-part-1-why-rust-anthropic-migration — the page itself has the interactive charts and diagrams.*
