Why We Chose Rust for the Hot Path
Every request your app handles probably touches auth. Auth decisions, feature flag evaluations, rate limit checks — these aren’t occasional operations. They’re on the critical path, every time, for every user. That means the performance of your infrastructure becomes the performance floor of your product.
We thought hard about what to build the Flux hot path in. The answer was Rust.
What “Hot Path” Means
When we say hot path, we mean the operations that happen on every single request: is this session valid? is this feature enabled for this user? has this API key exceeded its quota? These decisions need to be fast in an absolute sense — not “fast for a managed service” but genuinely, measurably fast.
A garbage collector pause of 5ms might be acceptable in a batch job. On the hot path of a request that should take 50ms total, a 5ms pause is a 10% latency tax you pay unpredictably and often.
Why Rust
Rust gives us two things that matter most here: zero-cost abstractions and no garbage collector.
Zero-cost abstractions mean we can write expressive, high-level code without paying a runtime penalty. There’s no GC, no runtime, no JIT warmup. The code compiles to tight machine code that behaves predictably at every percentile, not just the median.
The result is numbers we’re proud of:
- 2 million auth events per second on a single node
- <5μs p99 flag evaluation — that’s microseconds, not milliseconds
- <1μs p99 rate limit check — faster than a round trip to L3 cache
These aren’t cherry-picked lab benchmarks. They’re what we observe in production, at load.
Predictable Latency Is the Point
Average latency is easy to optimize. Tail latency is where things get hard. A language with a stop-the-world garbage collector will produce occasional spikes that you can’t tune away — you can only reduce their frequency.
Rust doesn’t have this problem. The p50, p95, and p99.9 latency distributions are tight. When we say <5μs flag evaluation, we mean at the 99th percentile, not the median.
Not a Rust-Only Platform
We want to be direct about this: Flux is not just for Rust developers. We have SDKs for TypeScript, Python, Go, Ruby, Java, and more. You interact with Flux in whatever language you’re building in. Rust just happens to be what powers the engine underneath.
That said, if you are building in Rust — and a growing number of infrastructure-adjacent projects are — the experience is particularly good. The SDK is idiomatic, the types are expressive, and you’re calling into a system that was designed with the same values your code was.
The Rust Community
There’s something else about Rust that matters to us: the community. The focus on correctness, the investment in tooling (cargo is a genuinely great build system), the culture of writing software that does what it says — these feel aligned with what we’re building at Flux.
We’re big fans of projects like Catppuccin, the pastel color scheme that started as a personal project and became a community. That kind of craftsmanship — building something carefully, in public, with taste — is the spirit we want Flux to carry.
The hot path is in Rust because correctness and performance aren’t tradeoffs. They’re both just requirements.
Enjoyed this post? Get updates from the Flux blog.