Skip to content
Back to skills

Database Redis

ASecurity

For a general-purpose cache, the best default Redis eviction policy is `allkeys-lru`. Why `allkeys-lru` is usually the right choice: - It allows Redis to evict any key when memory is full. - It matches cache-oriented workloads where all cached entries are disposable. - It favors keeping recently used keys in memory, which usually improves hit rate for normal application traffic. Use `allkeys-lru` when: - Redis is being used mainly as a cache - Cached data can be recomputed or reloaded from a ...

  • 584 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
developmentgodatabase

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill database-redis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Database Redis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Database Redis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-database-redis-142f0b2e/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-database-redis-142f0b2e)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
For a general-purpose cache, the best default Redis eviction policy is `allkeys-lru`.

Why `allkeys-lru` is usually the right choice:

- It allows Redis to evict any key when memory is full.
- It matches cache-oriented workloads where all cached entries are disposable.
- It favors keeping recently used keys in memory, which usually improves hit rate for normal application traffic.

Use `allkeys-lru` when:

- Redis is being used mainly as a cache
- Cached data can be recomputed or reloaded from a durable database
- You want memory pressure handled automatically without relying on every key having a TTL

When not to use it:

- If Redis contains a mix of persistent keys and expiring cache keys, `volatile-lru` is often safer because only keys with TTLs are eligible for eviction.
- If critical state exists only in Redis, that is a design problem. Eviction policy should not be your protection for important data.

Practical guidance:

- Even with `allkeys-lru`, still set TTLs on ephemeral cache keys whenever practical.
- Add small TTL jitter for high-volume caches to avoid synchronized expiration bursts.
- Monitor cache hit ratio and eviction count after rollout. If hit rate is poor or evictions spike unexpectedly, revisit key size, TTL strategy, and memory sizing.

Operational reminder:

- Eviction policy is not a substitute for good key design.
- Keep values bounded in size.
- Avoid unbounded read patterns.
- Make sure Redis is supporting a durable primary database, not replacing it.

In short: choose `allkeys-lru` for a normal general cache, and choose `volatile-lru` instead only when Redis is serving a mixed workload with both persistent and expiring keys.

Files in this skill

  • eval-1.baseline.md2.5 KB
  • eval-1.with-skill.md2.6 KB
  • eval-2.baseline.md2 KB
  • eval-2.with-skill.md2.2 KB
  • eval-3.baseline.md1.8 KB
  • eval-3.with-skill.md1.6 KB
  • trigger-1.md159 B
  • trigger-2.md150 B
  • trigger-3.md155 B
  • trigger-4.md165 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.