Install any skill in seconds. Free to start, no credit card required.
Get Started Free →jeremylongshore/implementing-database-caching
Process use when you need to implement multi-tier caching to improve database performance. This skill sets up Redis, in-memory caching, and CDN layers to reduce database load. Trigger with phrases like "implement database caching", "add Redis cache layer", "improve query performance with caching", or "reduce database load".
Passed 15 of 22 test cases with the skill, and 10 of 22 without it.
and 7 more in the full report
6 fixed9 passed either way6 still failing1 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 6 test cases the skill fixed. Same model, same prompt, with and without the skill.
Our database is struggling under heavy read traffic from our product catalog and user profile endpoints. I need a multi-tier Redis caching strategy between our application backend and the database. Please produce the key schema naming document, an application cache wrapper module that handles cache hits/misses and mitigates stampedes, automatic invalidation routines for database updates, a Redis server setup configuration, and dashboard monitoring queries to track hit ratios and memory consumption.
| Checked | Without skill | With skill |
|---|---|---|
| sets maxmemory-policy to allkeys-lru | Missed | Passed |
| sets Redis tcp-keepalive to 60 seconds | Missed | Passed |
| sets user profile TTL to a duration between 15 and 60 minutes | Passed | Passed |
The instructions your model reads when the skill loads.
Implement multi-tier caching strategies using Redis, application-level in-memory caches, and query result caching to reduce database load and improve read latency. This skill covers cache-aside, write-through, and write-behind patterns with proper invalidation strategies, TTL configuration, and cache stampede prevention.
docker run redis:7-alpineredis-cli installed for cache inspection and debuggingProfile database queries to identify caching candidates. Focus on queries that: execute more than 100 times per minute, take longer than 50ms, return data that changes less frequently than every 5 minutes, and produce results smaller than 1MB. Use pg_stat_statements or MySQL slow query log.
Design the cache key schema with a consistent naming convention: service:entity:identifier:variant. Examples: app:user:12345:profile, app:products:category:electronics:page:1. Include a version prefix to enable bulk invalidation: v2:app:user:12345.
Implement the cache-aside pattern for read-heavy data:
GET app:user:12345:profileSET app:user:12345:profile <json> EX 3600DEL app:user:12345:profile to invalidateConfigure TTL values based on data change frequency:
Implement cache stampede prevention for high-traffic cache keys:
TTL * 0.8 with probability 1 / concurrent_requestsSET key:lock NX EX 5 to let one request refresh while others serve stale dataAdd application-level L1 cache using an in-memory LRU cache (Node.js: lru-cache, Python: cachetools, Java: Caffeine) for per-process caching of ultra-hot data. Set L1 TTL shorter than Redis TTL (e.g., 60 seconds L1, 5 minutes Redis).
test cases passed, vs 10 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.