<aside>
⚡
Буллеты про кэширование: Redis, Memcached, CDN, cache-aside, invalidation, rate limits, locks, streams и эксплуатация.
</aside>
Стратегии кэширования
- Introduced a Redis read-through cache on the X hottest endpoints, cutting p95 latency from Xms to Xms.
- Reduced database load X% by caching X read-heavy aggregates with a X-minute TTL and background refresh.
- Implemented cache-aside with singleflight deduplication, collapsing X concurrent misses into one origin call.
- Eliminated cache stampedes with probabilistic early expiration, removing X origin-overload incidents per month.
- Built a write-through cache keeping X entities consistent between Redis and PostgreSQL with zero manual invalidation.
- Designed a tag-based invalidation scheme covering X entity types, cutting stale-data bugs by X%.
- Added a two-tier cache (in-process LRU plus Redis), serving X% of reads without a network hop.
- Cut p99 latency X% by prewarming caches on deploy, removing the cold-start spike after every release.
- Introduced negative caching for X missing-key lookups, dropping origin traffic by X%.
- Raised cache hit ratio from X% to X% by reworking key granularity and normalizing query parameters.
- Moved X session lookups per second from the database to Redis, cutting authentication latency from Xms to Xms.
- Implemented stale-while-revalidate semantics, keeping p99 at Xms even while X% of keys were refreshing.
Redis как инфраструктурный примитив
- Built distributed locks on Redis with fencing tokens, serializing X critical sections across X service replicas.
- Implemented a token-bucket rate limiter in Lua, enforcing X requests/min per tenant across X instances atomically.
- Used Redis Streams as a lightweight event bus, delivering X messages/sec with consumer groups and at-least-once semantics.
- Built a sorted-set leaderboard serving X million entries with Xms rank lookups.
- Implemented delayed and scheduled jobs on sorted sets, processing X tasks/day without adding a broker.