All posts

Momento's Kotlin-to-Rust migration defied velocity fears

Huma ShaziaJuly 18, 2026 at 11:31 AM5 min read
Momento's Kotlin-to-Rust migration defied velocity fears

Key Takeaways

Kotlin to Rust: The Hard Truths of Rewriting a High-Scale Data Plane

Momento's Kotlin-to-Rust migration defied velocity fears
Source: InfoQ
  • Momento's Kotlin-to-Rust rewrite hit 600,000 TPS on larger instances, disproving assumptions about Rust's engineering overhead
  • Compile-time safety via the borrow checker shortened, not lengthened, the developer feedback loop
  • The team chose Rust for a non-performance-critical workflow server because the language expressed complexity more clearly

Engineers at Momento assumed rewriting their high-performance caching services from Kotlin to Rust would cost them five times the development effort. Three years later, Ruth Linehan says that assumption was wrong. Speaking at QCon San Francisco, the senior engineer detailed how Rust's compile-time guarantees actually accelerated their feedback loop, and the company now runs all its services in Rust, including ones that aren't performance-sensitive.

Advertisements

What benchmarks does Momento publish?

Momento runs daily performance tests against its caching infrastructure. The baseline benchmark hits roughly 60,000 transactions per second with 3 millisecond latency at the 99.9th percentile on mid-sized instances. When pushing larger instances, the team has reached 600,000 TPS. Those numbers matter because Momento competes directly with managed Redis and Memcached offerings where latency spikes translate to customer churn.

The migration started with the most latency-sensitive services. Performance was the initial driver. But Linehan's talk focused less on raw throughput and more on what surprised the team: Rust didn't slow them down.

Why did Rust shorten the feedback loop?

The conventional wisdom is that Rust's borrow checker punishes developers with long compile cycles and cryptic errors. Linehan argues the opposite. When the compiler catches memory issues before runtime, you spend less time debugging production incidents. The feedback loop, from code change to validated behavior, actually shrinks because you're not waiting on integration tests or staging environments to surface concurrency bugs.

She pointed to tools like Criterion for micro-benchmarking and flamegraphs for profiling concurrent code paths. These aren't Rust-exclusive, but they slot cleanly into a workflow where the compiler has already eliminated whole categories of runtime failure.

We thought we'd get performance improvements in Rust, but the engineering cost is going to be 5 times or more. What we learned from the past three years is that these two preconceptions weren't entirely true.

— Ruth Linehan, Senior Engineer at Momento

Why use Rust for a workflow server?

This year, Momento moved its most complex service, a workflow server, to Rust. The service isn't latency-critical. It doesn't need sub-millisecond response times. Linehan said the team chose Rust because they could express the workflow logic more clearly and with higher confidence than in Kotlin.

That's a significant claim. Kotlin's appeal has always been developer ergonomics: null safety, concise syntax, strong IDE support. Linehan isn't dismissing those strengths. She's arguing that once a team is fluent in Rust, the language's type system and ownership model make complex state machines easier to reason about.

Linehan explicitly disclaimed any universal recommendation. She told the audience not to rewrite everything into Rust. But if you're already rebuilding a service, or starting fresh, Rust deserves consideration for reasons beyond raw speed.

Advertisements

Does Rust require C or C++ experience?

Linehan noted that she has no C or C++ background. Her prior languages include Ruby, Clojure, Go, and Kotlin. She still picked up Rust and contributed to production services. The implication: you don't need systems programming ancestry to be productive.

Stack Overflow's annual survey has ranked Rust the "most admired" language for seven consecutive years. Roughly 30% of developers express interest in learning it. The gap between admiration and adoption is shrinking, and talks like Linehan's help close it by offering concrete production data rather than language-war rhetoric.

ℹ️

Logicity's Take

Momento's experience maps to a pattern we're seeing at other latency-sensitive infrastructure companies. The borrow checker's upfront cost is real, but teams that push through the initial learning curve report fewer late-night pages and faster iteration once the compiler is their ally. For engineering managers weighing Rust adoption, the question isn't whether your team can learn it. It's whether your domain has enough concurrency or memory-safety risk to justify the investment. Caching, pub/sub, and message brokers fit that profile. CRUD apps probably don't.

What tooling did Momento rely on?

Linehan highlighted two profiling approaches. Criterion is a statistics-driven benchmarking library for Rust that guards against noisy measurements. Flamegraphs visualize stack traces to pinpoint where concurrent code paths spend time. Neither tool is new, but both integrate tightly with Rust's ecosystem.

The broader lesson: Rust's performance story isn't magic. It's the result of compile-time safety combined with mature observability tooling. Teams that skip profiling will leave gains on the table regardless of language.

Frequently Asked Questions

How long did Momento's Kotlin to Rust migration take?

Linehan referenced three years of cumulative migration work, starting with the most performance-sensitive services and concluding this year with a complex workflow server.

What throughput does Momento achieve in Rust?

Daily benchmarks hit 60,000 TPS at 3ms p99 latency on moderate instances. Stress tests on larger instances exceed 600,000 TPS.

Do you need C or C++ experience to learn Rust?

Linehan explicitly stated she has no C or C++ background, suggesting systems programming experience isn't a prerequisite.

Is Rust only useful for performance-critical code?

No. Momento chose Rust for a workflow server that isn't latency-sensitive because the type system helped express complex logic more clearly.

What profiling tools does Momento use with Rust?

Criterion for micro-benchmarking and flamegraphs for visualizing concurrent code paths were both mentioned in the talk.

Also Read
SQLite needs Rust-style editions to fix its broken defaults

Another perspective on Rust's influence on language and library design decisions.

ℹ️

Need Help Implementing This?

If your team is evaluating Rust for latency-critical services, start with a bounded proof-of-concept on a single hot path. Measure before and after. The benchmarks, not the hype, should drive the decision.

Source: InfoQ

H

Huma Shazia

Senior AI & Tech Writer

Produced with AI assistance and reviewed by the Logicity editorial team. Learn more in our Editorial Policy.