database-redis
/database-redis
Optimize Redis as cache and coordination infrastructure with TTL, eviction, and latency-aware key design. Use when implementing Redis caching, key invalidation, or Redis performance work.
- Author
- HoangNguyen0403 ↗
- Repository
- agent-skills-standard ↗
- Licence
- MIT
- Last repository change
- 22.10.2026
Assessment and security
- Files in this package
- 4
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 22.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Optimize Redis as cache and coordination infrastructure with TTL, eviction, and latency-aware key design. Use when implementing Redis caching, key invalidation, or Redis performance work.
Original author description
Optimize Redis as cache and coordination infrastructure with TTL, eviction, and latency-aware key design. Use when implementing Redis caching, key invalidation, or Redis performance work.
How it works
- Priority: P0 (CRITICAL)
- Rules
- Verify
- Anti-Patterns
- References
- Canonical response anchors
SKILL.md preview
---
name: database-redis
description: Optimize Redis as cache and coordination infrastructure with TTL, eviction, and latency-aware key design. Use when implementing Redis caching, key invalidation, or Redis performance work.
metadata:
triggers:
files:
- '**/*.ts'
- '**/*.js'
- '**/redis.config.ts'
keywords:
- redis
- cache
- ttl
- eviction
upstream:
- name: redis
source: github
repo: redis/redis
pinned: "7.4.0"
tag_pattern: "^(\\d+\\.\\d+\\.\\d+)$"
reviewed: "2026-06-17"
---
# Redis Best Practices
## **Priority: P0 (CRITICAL)**
Redis is fast only when key shape, TTL ownership, and command complexity are explicit.
## Rules
- Namespace keys by product/domain and entity.
- Give cache keys a TTL or a documented reason not to expire.
- Pick eviction policy to match workload: `allkeys-lru` for general caches, `volatile-lru` for mixed persistent/ephemeral data. Monitor hit rate and evictions.
- Avoid slow or unbounded commands in hot paths; prefer `SCAN` over `KEYS` and `UNLINK` over `DEL` for large-key deletion. `lazyfree` settings help background reclamation.
## Verify
- [ ] Key naming identifies owner and invalidation scope.
- [ ] TTL or eviction policy exists for non-durable data.
- [ ] Large reads use bounded range/scan patterns.
- [ ] Connection timeouts and pool settings are explicit.
- [ ] Critical state does not exist only in Redis.
## Anti-Patterns
- **No sole truth in Redis**: Always persist critical data to durable primary database.
- **No large blobs**: Split values > 100KB into smaller keys or use Hashes for field access.
- **No JSON for objects**: Use `HSET` for object fields to enable O(1) access without full decode.
- **No TTL-less keys**: Set TTL or eviction policy on all non-permanent keys to prevent unbounded growth.
- **No `KEYS` in app paths**: use `SCAN` or explicit index keys.
## References
- [Framework Map](../references/framework-map.md)
- [Best Practices Guide](references/best-practices.md)
- [Checklist](references/checklist.md)
## Canonical response anchors
When this skill applies, preserve the following domain terminology or equivalent concrete examples in the answer when relevant:
- lazyfree
Files in this package (4)
- SKILL.md 2 KB
- evals/evals.json 2 KB
- references/best-practices.md 3 KB
- references/checklist.md 2 KB
Versions
The database has no other skills named database-redis.
Database snapshot: 13.11.2026 · package version 27366494c1cd (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100spring-data-redis
Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config. - 100redis-data-structures-caching
Use this skill when implementing cache-aside, write-through, strings, hashes, sorted sets, and TTL eviction policies in Redis. - 90cache-design
Design a caching strategy for an application — pattern selection, key design, TTL, and eviction policy. Use when asked to "add caching to this", "design a cache strategy", or "what should we cache". - 100spring-data-redis
Use when implementing caching, session storage, rate limiting, or any Redis integration. Covers cache-aside pattern, key naming, TTL strategy, and serialization config. - 100redis-cache-tests
Use when Redis is the app's cache and its behavior needs tests, or when choosing a cache invalidation strategy: TTLs, cache-aside write and invalidate, eviction under memory pressure, pub/sub invalidation across nodes and tenant key namespaces, plus stampede and stale-while-revalidate patterns. - 100caching-strategies
Design multi-tier caching architectures for web applications — cache-aside vs write-through vs write-behind, TTL design, cache invalidation, Redis patterns, CDN configuration, browser caching, and stampede prevention. Use when choosing a caching pattern, designing cache…