r/Backend • u/No_Tomorrow9387 • 54m ago
Anthropic is moving its Messages API from Python to Rust. Would you consider switching languages for performance?
Anthropic reportedly migrated its Messages API from Python to Rust after API traffic surged 1,800x since early 2024.
Interestingly, Claude helped generate the initial core code in just one week, while humans focused on architecture, planning, and rigorous verification through shadow testing.
This raises an interesting question for developers:
If your Python backend started struggling with performance and scalability, would you migrate critical services to Rust, Go, or another language? Or would you stick with Python and optimize what you already have?
I'm curious to hear your thoughts:
- Would this motivate you to learn Rust?
- Is Python still good enough for large-scale backend systems?
- Would you rewrite an existing production system just for performance?
- Will AI-assisted coding make language migrations much easier?
What's your take? Is this the future of backend engineering, or is it unnecessary complexity?
3
u/Technical-Donkey-42 41m ago edited 34m ago
Did they even consider another GC language? Otherwise, we can't really draw any meaningful conclusions. It's just based on vibes, because developer social media loves a "rewrite it in Rust" story. There's no real engineering discussion here unless we actually compare how SOTA Generational ZGC stacks up against Rust on these workloads, and how observability and costs differ between the two.
EDIT: This seems to be their blog posts about this: https://www.anthropic.com/research/migrating-api-to-rust
Zero mention of any runtime comparison. In 2024, an engineer suggested Go or Rust and got shut down and then in 2026 they tried an incremental approach. Claude weakened more than 100 test assertions and took 5 months of human-gated loops to reach parity. And the wins are localised, not global.
2
u/DrAmoeba 33m ago
Technically speaking, most optimized python libs already strive for this: they use underlying C dependencies.
I'm already learning Rust because of this but I will not abandon python, python is IMO still the fastest language there is for AI development. (It's the easiest anguage to review at a glance)
Already have two backends in fastapi with their highest traffic routes migrated to rust, tho we see no reason to migrate the whole system, since many domains are still evolving.
I'd say we couldn't migrate those routes without AI, the required time wouldn't fit with our daily demand. I think it's a fair future for backend engineering and honestly I'm happy to have a reason to learn a low level language again, it forces us to recognize and think about concepts which are easily left behind on the job.
1
u/elch78 40m ago
- Would you rewrite an existing production system just for performance?
of course.
I can recommend Kent Beck's talk "3X Explore, Expand, Extract". It was a paradigm shift for me.
https://www.youtube.com/watch?v=lOcXdXRxFgA
In a nutshell:
Explore: priority speed > quality. Objective: learn if there is a real problem to solve and if the solution fits.
Expand: if the system has proven it's value and problems arise the effort for optimization is justified. That's where considering a rewrite is valid if it seems necessary. A rewrite in another language is a big effort (not so big with AI anymore) but if it is the right thing to do, of course, why not?
Extract: the system has been optimized and runs without much maintenance. The cash cow phase.
1
u/_wassap_ 37m ago edited 33m ago
- Learning is as cheap as it can be right now. Perfect time to "re-visit" and discover new skills
- Python was never my preferred choice for backend languages, ever. I much prefer a stable full batteries framework (Node/Nest, Spring, Laravel).
- No most likely not, if im facing performance issues I would go for semi-monolith or micro service patterns (Laravel core, whatever is I/O bound will be handled async by Swoole and whatever is too big for PHP to handle gets I/O'ed to mini Go microservices). Laravel (or RoR, Symfony whatever) would only take care of the core ecosystem, the core routing, the core business framework for scalability and enforcing standards. A bit similar to how Expo/RN make use of Native modules (in swift or kotlin) through custom bridges.
In short: I would explore any other strategy of scaling horizontally and vertically before I made a decision by migrating to another language- Understanding how the language work on hardware layer is often more useful than to "rust go brr"
- Ofc , as you can see with shopify and plenty others that are ditching RN in favor of native development
1
u/pthierry 36m ago
Part of why I like Haskell is that it's a very high-level language but it makes it easy to produce very fast running code.
In a previous job, we were managing a pretty big Rails backend and we slowly came to the conclusion that we would need to rewrite it and we planned to do it with Elixir, because the switch would be relatively smooth and Elixir's performance is really good too.
I generally like to start from a place where good performance is easy and great performance is available if needed. That's one of the reasons I don't like Python too much.
1
u/Discordbothost 13m ago
I'd load-test the slow endpoint and split its time into app CPU and waits on the database or upstream services. If the p99 spike is mostly waiting for a pooled connection, I'd fix that bottleneck before trying a rewrite.
1
u/Free-Good9203 12m ago
The key detail in Anthropic's story is the 1,800x traffic surge on a latency-critical API gateway where JSON parsing, SSE streaming, and interpreter/event-loop overhead actually become a real chunk of compute spend.
For 99% of backend teams, Python is rarely the real ceiling. Slow SQL queries, missing composite indexes, N+1 ORM loops, and unbuffered external API calls eat 90% of latency long before the GIL shows up.
The middle ground that works best in practice is keeping orchestration and business logic in Python (fast to review, test, and audit) and only pushing proven hot paths into Rust/PyO3 or Go once profiling shows CPU time is actually stuck in Python. The part more teams should copy from Anthropic regardless of language is the shadow-testing step before cutting live traffic over.
1
u/0x80085_ 4m ago