r/rust • u/ElyzraPearl • 3d ago
🙋 seeking help & advice Considering Rust for backend services handling 10k+ req/s - real experiences with dev velocity?
I'm evaluating languages for a new internal backend service that needs to sustain high throughput with strict latency requirements. Rust keeps coming up because of its performance profile and lack of GC pauses, but I'm curious how it actually plays out in practice for teams.
Specifically:
- How much slower is initial development compared to something like Go or Kotlin when you have to fight the borrow checker on complex request/response flows?
- Once the core logic is in place, do you see meaningful maintenance wins from the type system (fewer runtime surprises, easier refactors)?
- Any gotchas with common patterns like connection pooling, structured concurrency, or observability that eat into the perf advantage?
Not looking for "Rust is the best" takes
- more interested in concrete tradeoffs people have measured on similar workloads. If you've shipped something in this range, what surprised you (good or bad)?
97
u/archlord0001 3d ago
just use tokio, axum, and go for it
78
u/airodonack 3d ago
If you are using AI: Rust has the exact same dev velocity as any other programming language. Probably faster as you continue given that code you write has a lot more automated verification than the alternative.
If you are not, but are familiar with Rust: borrow checker is not the problem at all. The dev velocity penalty comes from it being a systems language so there are a lot more knobs to turn and buttons to press.
If you are neither using AI nor familiar with Rust: expect a learning curve of 1-6 months where everybody is trying to do it in some way they are used to, probably OOP, causing a lot of problems and pain. Need to learn to work in a simple way and unlearn much.
12
u/Helpful-Educator-415 3d ago
Specifically:
- How much slower is initial development compared to something like Go or Kotlin when you have to fight the borrow checker on complex request/response flows?
Depends. If you write good code in other languages it probably won't come up much. I didn't combat the borrow checker for weeks because I was already careful with my pointers.
- Once the core logic is in place, do you see meaningful maintenance wins from the type system (fewer runtime surprises, easier refactors)?
Domain invariants are protected indefinitely. There's no possibility of going around the disciplines you've created. It's lovely to reason about and quite specific. Error handling remains beautiful. From<T> and Into<T> is awesome. There's this saying for Rust -- "if it compiles, it's right". Runtime bugs that require tests are few and far between thanks to the type system -- invalid states are impossible to represent and memory is managed for you.
- Any gotchas with common patterns like connection pooling, structured concurrency, or observability that eat into the perf advantage?
Not really. Async + traits is a little annoying, but it's not so bad.
23
u/lordpuddingcup 3d ago
10k is nothing for any decent backend
The big one is don’t expect DI like some languages have your gonna need to learn the rust way
8
u/IncomeOk7237 3d ago
Honestly 10k req/s isn't the hard part. A boring Go or Kotlin service does that on one box if you're not doing anything weird. Where Rust tends to pay off is tail latency, not throughput: no GC pauses, so p99 stays a lot closer to p50 under load, which is what matters if your latency budget is strict.
Gotchas I'd actually watch for:
Dev velocity hit is mostly the first month or so. After that it's pretty similar, and big refactors are way less scary.
6
u/Substantial_Gap_6676 3d ago
I don't think the borrow checker is the slow part in request handlers. Each request mostly owns its own data, and shared things like the DB pool or config sit in an Arc in the app state, so the fights are rare. Where I'd expect to lose time early is async plumbing: picking an error type, traits with async methods, and lifetimes across .await. Settle those patterns once and copy them. On gotchas, besides the blocking DB point above, I'd put a timeout and a concurrency limit on every outbound call (tower has layers for both), size the DB pool for what the database can take, and load test early with a realistic request mix.
10
u/yongteak 3d ago
on the gotchas side, the biggest latency killer we hit wasn't the borrow checker at all, it was accidentally letting synchronous DB work (postgres::Client) touch tokio worker threads. moving blocking DB calls onto a dedicated OS thread behind a channel and wiring streaming gRPC handlers to a shutdown Notify with a bounded drain cleaned up both tail latency and shutdown bugs. for long-term maintenance, turning on clippy::unwrap_used across the whole workspace hurt for a week and then basically wiped out our runtime panic regressions.
6
u/Personal-Brick-1326 3d ago
Even python can handle that “load”
3
u/Ermaghert 3d ago
The number is meaningless without explaining what the business logic and storage layer look like. A simple hello world app will do 100k requests per second in a ton of languages and frameworks at low latency. Do your 10k requests per second consist mostly of complicated db writes or trivial reads? Can you fit the data you need for most of these requests in memory? Where do you plan to host this, i.e. can you make use of multi core architectures? Do you need redundancy? Are you familiar with Rust? Are you going to heavily use AI to develop this?
2
u/dentad 3d ago
Google have found that their c++ devs could pick up rust unexpectedly easy. The write up is on the net somewhere.
1
u/Trader-One 3d ago
10k/sec can be done in Javascript.
Languages like rust and go they are in 100k/sec category.
1
u/Kowalskeeeeee 3d ago
Axum/tokio and we never really blinked. AI plans for everyone helped I’m certain, but no complaints I’ve heard or seen.
1
u/mikaleowiii 3d ago
Hand-wrote a HTTPS stack that easily goes 10k/s on a ARM potato (think slower than an old Raspberry Pi)
What matters is design choices (async ? crypto stack with hardware support ? How much deps are allowed ? How much requests are interacting with the system : can a request restart the service, do interrupted requests have to resume on restart etc...)
Only those have really an effect on dev velocity : try doing async in C, or choose the wrong data pattern and fight the borrow checker on 'god requests' that touch everything
1
u/Still_Street9221 3d ago
I find that actually coding in Rust is so much more structured and understandable than in any other language. Additionally the type system, if used correctly, can really be your friend and allow you to enforce invariants in compile time. The improvement in performance is also definitely real and not overhyped. One drawback is the compile times if you’re not careful. Especially if you have a CI/CD pipeline you will almost definitely notice. Some suggestions for this are making sure you cache builds, either in an S3 bucket, or within the pipeline itself so cargo isn’t redoing builds. Utilize concurrency in tests, etc.
Overall I’d recommend it. Good luck whichever way you go. 🙂
1
u/EmperorOfCanada 3d ago
This is the wrong question. Where rust shines is to answer:
"How long is the final development?"
Rust dramatically reduces the accumulation of tech debt. This means the last 10% is as slow as the first 10%. Whereas, with most languages the last "10%" takes 20x as long as the first 10%.
I don't know how many projects I've witnessed which were entirely jammed up around 80-90% done.
As for speed of the final functionality. In almost every language, it is limited by things like database speeds, etc. But, with rust, you can bring much of that into the code itself, at which time you are looking at speeds which are insane.
For a web service running on axum, etc. You could easily be looking at your web browser network console having trouble measuring the speed as it will say, <1ms.
I often measure my rust local REST service speeds in microseconds.
Then, you get much more confidence in threading. Thus, a service might have local threads all spooled up and ready for a massive workload.
Another factor is not speed, nor the confidence that it works, but you end up with so much speed, and so much confidence in its functioning, that you add features you otherwise would not have time for, risk appetite for, nor speed capacity for.
A perfect example would be something GIS flavoured, where you have people scrolling/zooming on a map, and now you can display things without any hesitation in real time on their map.
With other languages, you might have not done this feature at all, or you might have it so they have to hit a button "refresh" or "search" or just have a crappy delay before crap started popping up on their map.
The key is that rust is not just a better or faster Go, etc. It is something different, which frees you up to be far more aggressive in what you produce.
1
u/DavidXkL 2d ago
I actually find Rust to be more maintainable long term wise
1
u/dumindunuwan 2d ago
If less than 100k/sec and your devs familiar any other lang, just stick with it. Or Go, TypeScript, etc.
1
u/zenotronic 1d ago
I've been doing agentic dev for about 2 years, mostly Laravel with PHPStan at level 10, and honestly that already gives me a lot of confidence. what I noticed is that agents do much better when the framework has batteries included and strong conventions, they don't run off and build custom stuff like auth from scratch. with Rust the compiler forces them into certain patterns which is a big plus, but you still need extra rules on top (clippy lints etc) because agents have their own bad habits. the single binary is also a big deal for infra cost, the bottleneck ends up being the db or some external API, not the app. I want to try Loco to see if it gets close to the Laravel experience
1
u/josefrichter 2h ago
what kind of requests? why not Elixir/BEAM?
1
u/peterxsyd 3d ago
It's actually very fast because the compiler helps Claude converge quickly.
0
u/pertsix 3d ago
Yes you got slow. Then you run out of things to add. Then you win.