How a TikTok Intern Saved $300,000 by Rewriting One Service in Rust

Lessons To Learn and Key Points To Consider Before Starting Microservice Rewrite

A TikTok intern named Wu Xiaoyun saved the company about $300,000 per year simply by rewriting one performance-critical Go service in Rust. But the real story isn’t just about speed or cost savings. It’s about when Rust is worth the effort and when it isn’t.

To understand it, you need a bit of context. Let’s dive into the details with the Tik-Tok problem at scale. You can read the full article here.

The Problem: TikTok Live Payments Were Burning CPU

TikTok Live lets viewers send virtual gifts to streamers. These gifts are purchased with real money, processed through a payment service that handles millions of requests per second.

Wu noticed that some endpoints in the payment service were regularly hitting over 90% CPU usage, triggering alerts. The system worked, but it was expensive to run at scale.

The service was originally written in Go, which is fast and developer-friendly, but it does rely on garbage collection and higher-level abstractions that can add CPU overhead when pushed to extremes.

Leave a Reply