Skip to content
Back to skills

Database Redis

ASecurity

For a multi-tenant Redis design, make the key name encode tenant, domain, entity, and purpose so ownership and invalidation scope are obvious at a glance. A good default pattern is: `<product>:tenant:<tenantId>:<domain>:<entity>:<identifier>[:<variant>]` Examples: - `app:tenant:t_42:user-profile:user:123` - `app:tenant:t_42:catalog:product:987:summary` - `app:tenant:t_42:rate-limit:api-key:abc123` Why this shape works: - It prevents tenant collisions. - It makes bulk reasoning safer because t...

  • 584 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentgoapi

Works with

  • api

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-agent-skills-standard/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-database-redis-agent-skills-standard)

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 multi-tenant Redis design, make the key name encode tenant, domain, entity, and purpose so ownership and invalidation scope are obvious at a glance.

A good default pattern is:

`<product>:tenant:<tenantId>:<domain>:<entity>:<identifier>[:<variant>]`

Examples:

- `app:tenant:t_42:user-profile:user:123`
- `app:tenant:t_42:catalog:product:987:summary`
- `app:tenant:t_42:rate-limit:api-key:abc123`

Why this shape works:

- It prevents tenant collisions.
- It makes bulk reasoning safer because the tenant boundary is explicit.
- It gives you predictable invalidation scope. For example, deleting or rotating all cached product summaries for one tenant is much easier when those keys share a clear prefix.

Recommended rules:

1. Put the tenant identifier near the front of the key.
   - This makes tenant scope obvious in logs, dashboards, and scan-based maintenance jobs.

2. Namespace by business domain.
   - Use segments like `billing`, `catalog`, `session`, `feature-flag`, or `rate-limit` instead of generic names like `data` or `cache`.

3. Include only stable identifiers.
   - Prefer immutable IDs over mutable names or emails so keys do not drift when attributes change.

4. Add a variant suffix when the same entity has multiple cache shapes.
   - Example: `product:987:summary` vs `product:987:details`.

5. Set a TTL for ephemeral data.
   - Cache entries, sessions, throttling windows, temporary coordination locks, and derived views should expire unless you have a documented reason not to.
   - For high-traffic caches, add small TTL jitter so many keys do not expire at the exact same moment.

6. Do not store critical system truth only in Redis.
   - Redis should support latency and coordination, not be the only durable record for tenant-critical data.

7. Avoid oversized values.
   - If a value grows large, split it into smaller keys or use a Hash for field-level access instead of storing one big serialized blob.

Practical examples by use case:

- Cached object:
  - `app:tenant:t_42:orders:order:5001`
- Session:
  - `app:tenant:t_42:session:s_abc123`
- Rate limit bucket:
  - `app:tenant:t_42:rate-limit:user:123:/reports/export`
- Distributed lock:
  - `app:tenant:t_42:lock:invoice:5001`

Operational guidance:

- Never use `KEYS app:tenant:t_42:*` in application paths. If you need to inspect or clean up by prefix, use `SCAN` in admin or background workflows.
- Make connection timeouts and pooling explicit in the application config.
- Document which service owns invalidation for each major key family.

In short: design Redis keys so they answer three questions immediately — which tenant owns this, what data family it belongs to, and how it should be invalidated.

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.