Redis Data Structures & Caching Best Practices
Comprehensive Redis framework with 50+ rules across data structures, caching patterns, session management, pub/sub messaging, and performance optimization. Designed for high-performance caching, session storage, and real-time applications.
When to Apply
Reference these guidelines when:
- Implementing application caching (Django, FastAPI)
- Managing user sessions and authentication
- Building real-time features with pub/sub
- Optimizing database performance with Redis
- Implementing task queues and job processing
- Building scalable web applications
- Managing distributed locks and rate limiting
Rule Categories by Priority
| Priority | Category | Impact | Rules | Prefix |
| --- | --- | --- | --- | --- | --- |
| 1 | Data Structures | HIGH | 12 | data- |
| 2 | Caching Patterns | HIGH | 15 | cache- |
| 3 | Session Management | MEDIUM-HIGH | 8 | session- |
| 4 | Pub/Sub Messaging | MEDIUM-HIGH | 6 | pubsub- |
| 5 | Performance Optimization | MEDIUM | 6 | perf- |
| 6 | Security & Deployment | MEDIUM | 4 | security- |
Quick Reference
1. Data Structures (HIGH)
data-strings: String operations and atomic countersdata-hashes: Hash maps for object storagedata-lists: Ordered collections and queuesdata-sets: Unique element collectionsdata-sorted-sets: Ordered unique elements with scores
2. Caching Patterns (HIGH)
cache-django: Django cache framework integrationcache-fastapi: FastAPI response cachingcache-database: Database query result cachingcache-api: API response caching with invalidation
3. Session Management (MEDIUM-HIGH)
session-django: Django session storage in Redissession-custom: Custom session managementsession-security: Secure session handling
4. Pub/Sub Messaging (MEDIUM-HIGH)
pubsub-channels: Channel-based messagingpubsub-patterns: Pattern matching subscriptionspubsub-integration: Application integration patterns
5. Performance Optimization (MEDIUM)
perf-persistence: RDB and AOF configurationperf-memory: Memory management and eviction policiesperf-connection: Connection pooling and pipelining
6. Security & Deployment (MEDIUM)
security-auth: Authentication and access controlsecurity-encryption: Data encryption at restsecurity-deployment: Production Redis deployment
Quick Start
- 📖 Overview:
skills/redis-skill/SKILL.md - 📚 Complete Reference:
skills/redis-skill/AGENTS.md - 🔍 Specific Rules:
skills/redis-skill/rules/[category]-[rule-name].md