Grab's Common Data Service (CDS) has evolved its caching strategy to horizontally scale its Redis-based cache system. This involved implementing a custom sharding mechanism to distribute cache keys across multiple ElasticCache instances, addressing the limitations of single-threaded Redis and the potential bottleneck of a centralized proxy like Twemproxy. The new design allows for increased caching capacity and improved P99 latency under heavy load. This post details an investigation into Redis key expiration consistency issues on read replicas, revealing that slaves do not expire keys unless explicitly told by the master, and that passive expiration is too slow at scale. The findings led to recommendations to upgrade Redis versions more frequently and pay closer attention to cache invalidation strategies during software design.
All Grab trails