Counter Service: How we rewrote it in Rust

201 points Rust_Fan8901 24 comments

As a long time fan of Rust, finally managed to push through a rewrite of one of our Golang microservices in Rust at my company (it's like ride hailing for south east Asia).

TLDR:

  • Rust is not "faster" than Golang. At least not out of the box. (Don't expect your rewritten service to be blazingly fast by default. Golang is typically already "fast enough".)

  • Most of the practical gains come from efficiency. I have done a few other similar but smaller scale projects, and my general takeaway is that Rust will typically save you 50% of your cloud bill.

Hope you guys enjoy the read, I also briefly talk about my thought process on how to justify a rewrite. TLDR depends on ROI, and imo don't pick something that has too much legacy business logic baked in. Come with it from a lens of cost savings.