redis-patterns
Data structure selection, pub/sub patterns, Lua scripting, pipelining, and cluster topology strategies.
npx skills add vibeeval/vibecosystem --skill redis-patterns --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Redis Patterns Advanced Redis usage beyond simple key-value caching. ## Data Structure Selection ``` Use Case → Structure → Why Session store → Hash → Partial field updates without full deserialize Rate limiter → Sorted Set → ZRANGEBYSCORE for sliding window Job queue → List + Stream → BRPOPLPUSH for reliable queue Leaderboard → Sorted Set → ZREVRANGE with scores Unique visitors → HyperLogLog → O(1) cardinality, 0.81% error Feature flags → Hash → HGET per flag, HGETALL for bulk Presence (who's online) → Set → SADD/SREM, SMEMBERS Geolocation → Geo → GEOSEARCH within radius ``` ## Distributed Lock (Redlock-lite) ```typescript import Redis from 'ioredis' const redis = new Redis(process.env.REDIS_URL!) async function acquireLock( key: string, ttlMs: number = 10_000 ): Promise<string | null> { const token = crypto.randomUUID() const acquired = await redis.set( `lock:${key}`, token, 'PX', ttlMs, 'NX' // Only set if not exists ) return acquired === 'OK' ? token : null } async function releaseLock(key: string, token: string): Promise<boolean> { // Lua script: only delete if token matches (atomic check-and-delete) const script = ` if redis.call("get", KEYS[1]) == ARGV[1] then return redis
- Data Structure Selection
- Distributed Lock (Redlock-lite)
- Sliding Window Rate Limiter
- Lua Scripting for Atomicity
- Pipeline for Bulk Operations
- Pub/Sub with Redis Streams
- Checklist
- Anti-Patterns
What does the redis-patterns skill do?
Data structure selection, pub/sub patterns, Lua scripting, pipelining, and cluster topology strategies.
How do I install it?
Run `npx skills add vibeeval/vibecosystem --skill redis-patterns --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From vibeeval/vibecosystem, a repository with 521 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
