Skip to content
FAQ

Uber Cuts Translation Cache Memory by up to 90% While Keeping P99 Latency Below 1 MS

Uber's 90% memory cut came from boring engineering: profiling, swapping a fancy concurrent map for a plain one, and moving cold data to disk.

1 min read

Uber’s 90% memory cut came from boring engineering: profiling, swapping a fancy concurrent map for a plain one, and moving cold data to disk.

Key points

  • Uber redesigned its Go-based translation cache, cutting initial memory footprint by more than 90% while keeping p99 cache-miss latency under 1 ms and the hit rate above 99.9%.
  • Profiling showed garbage collection eating more than 20% of CPU in some services, and translations made up about 70% of allocated objects.
  • Replacing sync.Map with a plain map[string]string guarded by an RWMutex cut allocations and improved CPU utilization by over 30% in the affected service.
  • A hybrid design keeps keys and hot values in memory and moves the rest to disk, because services touch only a small slice of 2–3 million keys.
  • The old refresh pattern built a full replacement cache before an atomic swap, so two copies sat in memory at once and caused out-of-memory failures. That is a common trap in read-heavy systems.

Why it matters

Uber didn’t need a new database to save 90% of its memory. It needed to read a profiler and admit that sync.Map was the wrong tool. Most ‘scale problems’ are measurement problems wearing a costume.

Sources

Sources

developer-tools industry

Frequently Asked Questions

What did Uber change in its translation cache?
Uber replaced Go's sync.Map with a plain map[string]string protected by an RWMutex. It also adopted a hybrid design that keeps keys and frequently used values in memory and stores the rest on disk. Together, these changes cut the initial memory footprint by more than 90%.
Why was sync.Map a problem for this workload?
sync.Map created multiple objects and pointers for each entry, which added garbage-collection pressure. The workload was read-heavy with few updates and no individual deletions, so a simple map behind a read-write lock fit better. The switch improved CPU utilization by more than 30% in the affected service.
Did moving data to disk hurt performance?
According to Uber, no. The redesigned cache keeps p99 cache-miss latency below one millisecond and the hit rate above 99.9% while serving millions of translations per second.
Share