GrabJia Long LohProblem & solution
Counter Service: How we rewrote it in Rust
Summary
The Integrity Data Platform team rewrote Counter Service, a high-QPS Golang microservice that consumes streams, writes counts to Scylla, and exposes gRPC queries backed by Scylla and Redis. They selected it because BatchRead reached tens of thousands of QPS while remaining constrained in functionality, making infrastructure savings potentially worth the rewrite effort and Rust learning curve. Rather than translating code line by line, the team treated the existing service as a black box, preserved its interfaces and contracts, and rebuilt the application logic from scratch; it also assessed Rust ecosystem support for dependencies including tonic, Actix Web, Fred, and the Scylla driver. The rewrite delivered similar performance with 70% infrastructure savings, according to the abstract. The conclusion reports the service as 80% cheaper, endorses Rust for new services, and cautions that async Rust is challenging.
Context
The team wanted to assess whether rewriting a Golang microservice in Rust could produce tangible infrastructure savings without making maintenance unsustainable. Counter Service was chosen because its BatchRead functionality served tens of thousands of QPS while remaining relatively constrained, and the team had to balance expected savings against rewrite complexity, engineering bandwidth, Rust’s learning curve, and ecosystem support.
Approach / What changed
The team treated the existing application as a black box with defined gRPC interfaces, contracts, and Scylla data, then rewrote its logic from scratch rather than translating Golang line by line. It mapped external dependencies, evaluated Rust libraries, and selected libraries based on required functionality and confidence in their support.
Takeaways
Counter Service’s BatchRead path served up to tens of thousands of QPS and queried counters through gRPC from Scylla and Redis.
The rewrite used a contract-first black-box approach instead of direct code conversion, aiming for outputs as close as possible to the original service.
The reported outcome was similar performance with 70% infrastructure savings in the abstract; the conclusion separately describes the service as 80% cheaper and warns that async Rust can be difficult.
Source and freshness
- Source
- engineering.grab.com
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.