redis-patterns

Guide Redis data structure selection for caching, queues, and rate-limiting use cases.

1|Updated Jan 6, 2026
One-click install
npx skills add https://github.com/hyukudan/ai-skills --skill redis-patterns-hyukudan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: redis-patterns
Source: https://github.com/hyukudan/ai-skills/tree/main/examples/skills/redis-patterns
Command: npx skills add https://github.com/hyukudan/ai-skills --skill redis-patterns-hyukudan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you choose the most effective Redis data structure and caching strategy for your specific use case, optimizing performance and resource utilization.

Core Features & Use Cases

  • Data Structure Selection: Guides you through choosing between Strings, Hashes, Lists, Sets, Sorted Sets, and Streams.
  • Caching Strategies: Explains Cache-aside, Write-through, Write-behind, and Stale-while-revalidate patterns.
  • Use Case: You need to implement a real-time leaderboard for a game. This Skill will guide you to use Redis Sorted Sets and provide the necessary commands.

Quick Start

Use the redis-patterns skill to understand when to use Redis Streams versus Pub/Sub for messaging.

Frequently Asked Questions about redis-patterns

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

FAQPage Schema
What is the best way to implement a real-time leaderboard using Redis?

Redis Sorted Sets are the best way to implement a real-time leaderboard, allowing you to rank members by score and retrieve top-N listings with simple, efficient commands.

How do I choose the right Redis data structure for session storage versus queues?

Choose Redis Strings or Hashes for session storage to map user attributes, and use Redis Lists or Streams for queues to manage ordered message processing and reliable delivery.

What's the difference between Redis Streams and Pub/Sub for messaging patterns?

Redis Streams provide persistent, consumer-group messaging with replay capabilities, whereas Pub/Sub offers fire-and-forget message delivery without storage or guaranteed message consumption.

How do I implement distributed locking and rate-limiting with Redis?

Implement distributed locking and rate-limiting with Redis using specific data structure patterns and decision frameworks that manage concurrent access and control request throughput efficiently.

When should I use Redis write-through caching versus cache-aside strategies?

Use Redis write-through caching when you need strict data consistency between your database and cache, and use the cache-aside strategy when you want to load data into the cache only on demand to optimize resource utilization.