advanced-patterns

Implement Redis design patterns for caching, locking, rate limiting, and messaging.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jsamuelsen11/claude-config --skill advanced-patterns-jsamuelsen11
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: advanced-patterns
Source: https://github.com/jsamuelsen11/claude-config/tree/main/plugins/ccfg-redis/skills/advanced-patterns
Command: npx skills add https://github.com/jsamuelsen11/claude-config --skill advanced-patterns-jsamuelsen11

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Advanced Redis patterns provide battle-tested solutions for caching, rate limiting, distributed locking, session management, and event-driven messaging, enabling reliable, scalable data flows across services.

Core Features & Use Cases

  • Cache-aside, Write-through, and Write-behind patterns for Redis-based data access and consistency.
  • Rate limiting patterns (fixed window, sliding window, and token bucket) to protect APIs and resources.
  • Distributed locking with SET NX EX, Redlock, and fencing tokens for safe coordination across processes.
  • Pub/Sub vs Streams for messaging, event delivery, job queues, and audit logs.
  • Session storage, leaderboards, and approximate counting with HyperLogLog to support rich features.

Quick Start

Review these patterns and apply a sample cache, lock, and rate-limiting flow to your Redis-backed services.

Frequently Asked Questions about advanced-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to implement distributed locks in Redis?

Distributed locks in Redis are best implemented using SET NX EX, Redlock, and fencing tokens to ensure safe coordination across processes. These patterns prevent race conditions while maintaining atomic operations.

How do I build a reliable rate limiter with Redis?

Build a Redis rate limiter using fixed window, sliding window, or token bucket patterns to protect APIs and resources. These approaches standardize reliability and regulate high-throughput workloads safely.

When should I use Redis Streams instead of Pub/Sub for messaging?

Use Redis Streams instead of Pub/Sub when you need event delivery persistence, job queues, or audit logs. Streams support reliable event-driven messaging and data pipelines, whereas Pub/Sub handles ephemeral broadcasting.

How do I implement cache-aside and write-through patterns in Redis?

Implement cache-aside and write-through patterns in Redis by structuring data access to maintain consistency across microservices. These patterns provide production-ready design solutions for scalable data flows.

Do I need Lua scripts for atomic Redis operations?

Yes, Lua scripts are required for atomic Redis operations when implementing advanced patterns like distributed locking and rate limiting. They ensure safe coordination and adherence to error-handling best practices.

Are these Redis patterns suitable for high-throughput microservices?

Yes, these Redis patterns are explicitly designed for high-throughput workloads across microservices and data pipelines. They support distributed coordination and real-time processing using appropriate data structures.