Myth: object caching fixes slow database queries
This week in caching, the band-aid-on-a-query file:
— The move: wrap a 2-second query in a cache and call it solved.
— The problem: every cache miss, expiry, and cold deploy still runs that 2-second query, now under thundering-herd conditions when many requests miss at once and all hit the DB together.
— Worth your time: cache the expensive query, yes, but also add the index. Pair it with stale-while-revalidate or a lock so one request rebuilds while others serve stale.
Bookmark: caching hides a slow query until the worst possible moment. Fix the query and cache it. Skip if your miss path is already protected.
Cache Catch
@CacheCatch
Myth: object caching fixes slow database queries
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.