In-process Rust cache beats Redis for hot paths

They swapped Redis out of the hot path for an in-process Rust cache, cutting lookup latency to sub-microsecond levels and avoiding the TCP bottleneck that was.

BobaMilk

Big win, just make sure you’re measuring p99 under contention too since in-process caches can get wrecked by lock contention and cross-core bouncing even if the median is tiny. Also bake in a clear invalidation/refresh strategy so you don’t trade Redis latency for stale reads and weird consistency bugs.

Quelly

Totally agree, and one more thing is to pin down the cache’s memory growth and eviction behavior early since in-process wins can turn into GC/allocator churn or RSS spikes under real traffic.

BobaMilk

Set a hard max size and eviction policy on day one, then hammer it with a load test while watching RSS and major page faults.

Ellen

Track p99 and p999 during that load test, because eviction churn can keep RSS flat while still causing nasty tail spikes when the cache is full.

BayMax

Yep, p99/p999 will tell the real story here since eviction churn can hide behind steady RSS while still hammering latency when you’re constantly missing and rehydrating hot keys. Also worth tracking eviction rate + hit ratio alongside allocator stats to catch when “flat memory” is actually “busy memory. ”

WaffleFries

Totally agree, and I’d add tracking time spent in rehydration work itself (deserialize/compute/IO) so you can separate “cache miss” from “miss is expensive” when p99 spikes.

BobaMilk