Oxidizing the Cloud

Jan 12, 202615 min readLevel: Hard

We migrated our ingestion pipeline from Node.js to Rust. The goal wasn't just "speed" – it was predictability under load. Here is the anatomy of the rewrite.

The Bottleneck

Our Node.js service suffered from GC pauses during high-throughput bursts (10k+ req/s). The event loop lag was killing our SLAs.

MEMORY FOOTPRINT (MB) - LOWER IS BETTER

Node.js (V8) 450 MB
Rust (Tokio) 15 MB

Zero-Cost Abstractions

Using traits to define behavior allowed us to mock external services without runtime overhead. The compiler optimizes the dynamic dispatch away in most cases.

main.rs
fn process_stream(stream: TcpStream) -> Result<()> {
  // No GC pauses here
  let mut buffer = [0; 1024];
  while stream.read(&mut buffer)? > 0 {
    parse_frame(&buffer);
  }
  Ok(())
}

"The result was a 95% reduction in infrastructure costs. We scaled down from 20 ECS tasks to just 2."