Skip to content
affaan-m avatar

Redis Patterns

Practical reference for Redis caching, rate limiting, distributed locks, pub/sub, and key design in production backends.

CCM score
71 of 100
skills.sh installs
9.1K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers cache-aside, write-through, and tag-based invalidation, plus session storage with hashes and TTLs
  • Includes fixed-window and atomic sliding-window rate limiters using a Lua script, and a single-node lock with a release check
  • Enforces a TTL on every key, with a suggested TTL table by data type to prevent memory pressure
  • Designed for backend teams adding caching, locks, or messaging to Redis, and for reviewing key naming and pooling

Install

$ npx -y skills add affaan-m/ecc --skill redis-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

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

Details

Repository
github.com/affaan-m/ecc
Categories
Backend & APIs, Databases
First seen
Jul 14, 2026

Questions

What does the redis-patterns skill help with?

The redis-patterns skill covers Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications. It gives the agent a quick reference of key design, TTL strategy, and Lua-based sliding window rate limiting.

When should I use the redis-patterns skill?

Use it when adding caching, a distributed lock, rate limiting, or pub/sub with Redis, or when Redis key design needs review. It also applies to session or token storage and to configuring pooling, eviction, or clustering in production.

How do I install the redis-patterns skill?

Run npx -y skills add affaan-m/ecc --skill redis-patterns -y in your project to install it. Once installed, the agent can apply the skill's cache-aside, locking, rate limiting, and stream patterns to your Redis code.

Where does redis-patterns rank in its category?

It sits in the Backend & APIs category and ranks in the top 100 on that category page. It is listed alongside entra-app-registration, neon, firebase-basics, firebase-auth-basics, and workers-best-practices.

More from affaan-m/ecc

All 257

Similar to Redis Patterns

More Backend & APIs