Agent skill · software engineering · affaan-m

redis-patterns

Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications. Use when adding caching, a distributed lock, rate limiting, or pub/sub with Redis, or when key design needs review.

Why this skill is useful

Provides specific Redis patterns and executable scripts for caching strategies and rate limiting that the AI wouldn't reliably generate on its own.

What it needs

Requires redis installed locally. About 6k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.

What this skill does

Redis Patterns Quick reference for Redis best practices across common backend use cases. How It Works Redis is an in-memory data structure store that supports strings, hashes, lists, sets, sorted sets, streams, and more. Individual Redis commands are atomic on a single instance; multi-step workflows require Lua scripts, MULTI/EXEC transactions, or explicit synchronization to stay atomic. Data is optionally persisted via RDB snapshots or AOF logs. Clients communicate over TCP using the RESP protocol; connection pools are essential to avoid per-request handshake overhead. When to Activate Adding caching to an application Implementing rate limiting or throttling Building distributed locks or coordination Setting up session or token storage Using Pub/Sub or Redis Streams for messaging Configuring Redis in production (pooling, eviction, clustering) Data Structure Cheat Sheet Use Case Structure Example Key ---------- ----------- ------------- Simple cache String product:123 User session Hash session:abc Leaderboard Sorted Set scores:weekly Unique visitors Set visitors:2024-01-01 Activity feed List feed:user:456 Event stream Stream events:orders Counters / rate limits String (INCR) ratelimit:user:123 Bloom filter / HLL HyperLogLog hll:pageviews Core Patterns Cache-Aside (Lazy Loading) Write-Through Cache Cache Invalidation Session Storage Rate Limiting Fixed Window (Simple) Sliding Window (Lua — Atomic) Distributed Locks Distributed Lock (Single Node — SET NX PX) For multi-node setups use the redlock-py library which implements the full Redlock algorithm. Pub/Sub & Streams Pub/Sub (Fire-and-Forget) Redis Streams (Durable Queue) Prefer Streams over Pub/Sub when you need delivery guarantees, consumer groups, or replay. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/redis-patterns--1e2619

View the source on GitHub

Browse the @skills marketplace