redis-expert
Expert configuration and implementation patterns for Redis caching and data management.
Install
mkdir -p .claude/skills/redis-expert && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14226" && unzip -o skill.zip -d .claude/skills/redis-expert && rm skill.zipInstalls to .claude/skills/redis-expert
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Redis expert. Caching strategies, session storage, rate limiting, pub/sub. Use for caching implementation and Redis configuration.Key capabilities
- →Install Redis server on Ubuntu or Docker
- →Set and retrieve string, hash, list, and set data types
- →Implement Cache-Aside, Write-Through, Write-Behind, and TTL caching strategies
- →Integrate Redis with Node.js for caching and session management
- →Apply rate limiting using Redis INCR and EXPIRE commands
- →Utilize Redis Pub/Sub for message broadcasting
How it works
Redis stores data in-memory as key-value pairs, allowing for fast read and write operations. It supports various data structures and can be integrated into applications using client libraries.
Inputs & outputs
When to use redis-expert
- →Implement Redis caching
- →Set up rate limiting
- →Configure session storage
- →Perform Redis key management
About this skill
Redis Expert
Installation
# Ubuntu
apt install redis-server -y
systemctl enable redis-server
# Docker
docker run -d --name redis -p 6379:6379 redis:alpine
Basic Commands
redis-cli
# Strings
SET key "value"
GET key
SETEX key 3600 "value" # With TTL (1 hour)
TTL key # Check TTL
# Hash (objects)
HSET user:1 name "John" email "[email protected]"
HGET user:1 name
HGETALL user:1
# Lists
LPUSH queue "task1"
RPOP queue
# Sets
SADD tags "node" "redis"
SMEMBERS tags
# Sorted Sets
ZADD leaderboard 100 "player1"
ZRANGE leaderboard 0 -1 WITHSCORES
Node.js Integration
import { createClient } from 'redis';
const redis = createClient({ url: 'redis://localhost:6379' });
await redis.connect();
// Cache pattern
async function getUser(id: string) {
const cached = await redis.get(`user:${id}`);
if (cached) return JSON.parse(cached);
const user = await db.user.findUnique({ where: { id } });
await redis.setEx(`user:${id}`, 3600, JSON.stringify(user));
return user;
}
// Invalidate
await redis.del(`user:${id}`);
Caching Strategies
| Strategy | Use Case | Implementation |
|---|---|---|
| Cache-Aside | Read-heavy | Check cache → Miss → Load DB → Store cache |
| Write-Through | Consistency | Write DB → Write cache |
| Write-Behind | Write-heavy | Write cache → Async write DB |
| TTL | General | Set expiration time |
Common Patterns
// Rate limiting
async function rateLimit(ip: string, limit = 100) {
const key = `rate:${ip}`;
const count = await redis.incr(key);
if (count === 1) await redis.expire(key, 60);
return count <= limit;
}
// Session storage
app.use(session({
store: new RedisStore({ client: redis }),
secret: 'secret',
resave: false,
saveUninitialized: false
}));
// Pub/Sub
await redis.subscribe('channel', (message) => {
console.log('Received:', message);
});
await redis.publish('channel', 'Hello!');
When not to use it
- →When a persistent, transactional database is required
- →For complex query patterns that require relational database features
- →When data integrity and durability are the absolute highest priority without additional persistence layers
Limitations
- →The skill focuses on basic commands and common patterns, not advanced Redis features or cluster management.
- →Node.js integration examples are provided, but other language integrations are not detailed.
- →The skill does not cover Redis persistence configurations or high-availability setups.
How it compares
This skill provides specific commands and Node.js integration examples for Redis, offering a direct approach to implementing caching and other patterns compared to manually configuring a database.
Compared to similar skills
redis-expert side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| redis-expert (this skill) | 0 | 6mo | Review | Beginner |
| supabase-developer | 95 | 7mo | Review | Intermediate |
| senior-backend | 14 | 7mo | Review | Advanced |
| database-migration | 3 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by ripgraphics
View all by ripgraphics →You might also like
supabase-developer
daffy0208
Build full-stack applications with Supabase (PostgreSQL, Auth, Storage, Real-time, Edge Functions). Use when implementing authentication, database design with RLS, file storage, real-time features, or serverless functions.
senior-backend
davila7
Comprehensive backend development skill for building scalable backend systems using NodeJS, Express, Go, Python, Postgres, GraphQL, REST APIs. Includes API scaffolding, database optimization, security implementation, and performance tuning. Use when designing APIs, optimizing database queries, implementing business logic, handling authentication/authorization, or reviewing backend code.
database-migration
wshobson
Execute database migrations across ORMs and platforms with zero-downtime strategies, data transformation, and rollback procedures. Use when migrating databases, changing schemas, performing data transformations, or implementing zero-downtime deployment strategies.
cloudbase-guidelines
TencentCloudBase
Essential CloudBase (TCB, Tencent CloudBase, 云开发, 微信云开发) development guidelines. MUST read when working with CloudBase projects, developing web apps, mini programs, or backend services using CloudBase platform.
prisma-connection-pool-exhaustion
blader
Fix Prisma "Too many connections" and connection pool exhaustion errors in serverless environments (Vercel, AWS Lambda, Netlify). Use when: (1) Error "P2024: Timed out fetching a new connection from the pool", (2) PostgreSQL "too many connections for role", (3) Database works locally but fails in production serverless, (4) Intermittent database timeouts under load.
pagination
dadbodgeoff
Implement cursor-based and offset pagination for APIs. Covers efficient database queries, stable sorting, and pagination metadata.