Uber Cuts Translation Cache Memory by up to 90% While Keeping P99 Latency Below 1 MS
- Go
AI Summary
Uber redesigned its Go-based translation cache using a hybrid architecture that keeps keys in memory and values on disk, reducing memory usage by up to 90%. By replacing sync.Map with a value-based map protected by an RWMutex and using 256 shards with disk-backed files, the system maintains a cache hit rate above 99.9% and keeps p99 latency below one millisecond while lowering garbage collection overhead.
Key Takeaways
- Replaced sync.Map with map[string]string and an RWMutex to reduce object allocations and pointer overhead.
- Adopted a hybrid storage layout with 256 shards, keeping all keys in memory and storing values in disk-backed files.
- Maintained a cache hit rate above 99.9% while dropping memory usage from gigabytes to megabytes.
Why it matters
Demonstrates how large-scale Go services can mitigate high garbage collection overhead and excessive memory footprints through value-based maps and hybrid in-memory/disk storage architectures.
Conversation0
What would you add from your experience?
Checking your session…
Every good conversation starts with one perspective.