redis
This skill walks you through deploying and operating Redis across single-instance, Sentinel, and cluster modes. Learn core commands for strings, hashes, lists, and sorted sets; configure persistence with RDB snapshots and AOF; implement caching, rate limiting, pub/sub, and distributed locking patterns; and run Redis in Docker with monitoring.
Redis helps you set up in-memory caching, queues, and data storage with clustering and failover.
AI-generated summary based on this skill's SKILL.md
Decision gist · record as of 2026-05-22
Redis helps you set up in-memory caching, queues, and data storage with clustering and failover. This skill walks you through deploying and operating Redis across single-instance, Sentinel, and cluster modes. Learn core commands for strings, hashes, lists, and sorted sets; configure persistence with RDB snapshots and AOF; implement caching, rate limiting, pub/sub, and distributed locking patterns; and run Redis in Docker with monitoring.
Use it when
- Redis offers two persistence mechanisms.
- Redis high availability uses Sentinel or Cluster modes.
Verify before relying
Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.
Similar skills
Install
BagelHole/DevOps-Security-Agent-Skills/redis · repository language: Shell
Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.
Frequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How to set up Redis caching for my application?
Redis caching setup begins with installation and basic configuration. Start by installing Redis, then configure your redis.conf file with memory limits, eviction policies, and bind addresses. Redis provides string, hash, list, and sorted set data types optimized for fast lookups. Use SET/GET commands for simple caching, or HSET/HGET for structured data. For production, run Redis in Docker using a docker-compose.yml file that exposes port 6379 and mounts a persistent volume. Configure maxmemory and maxmemory-policy (e.g., allkeys-lru) to handle memory constraints automatically.
What are Redis persistence RDB and AOF options?
Redis offers two persistence mechanisms. RDB (Redis Database) creates point-in-time snapshots at intervals you specify—fast to load but may lose recent data if Redis crashes. AOF (Append-Only File) logs every write command, providing better durability but slower performance and larger disk usage. Redis persistence configuration lets you combine both: RDB for recovery speed and AOF for safety. Configure save directives (e.g., 'save 900 1') and appendonly yes in redis.conf. Choose based on your tolerance for data loss versus performance requirements.
How do I configure Redis for high availability?
Redis high availability uses Sentinel or Cluster modes. Sentinel monitors master-replica replication and automatically promotes a replica to master on failure—ideal for simpler setups. Configure multiple Sentinel instances (minimum 3) pointing to your master Redis instance. Cluster mode shards data across nodes, distributing load and storage. For Sentinel failover setup, define sentinel.conf with monitor directives and quorum settings. Both modes require careful network configuration and monitoring to detect and respond to failures automatically.
What is distributed locking with Redis and how is it used?
Redis distributed locking coordinates access to shared resources across multiple processes or servers. Implement it using SET with NX (only if not exists) and EX (expiration) flags: SET key value NX EX seconds. This ensures atomic lock acquisition and automatic release if the process crashes. Use Lua scripts for complex lock logic. Distributed locking enables rate limiting, preventing duplicate job processing in queues, and coordinating cache updates. Always set reasonable TTLs to avoid deadlocks.
How can I monitor Redis performance and troubleshoot OOM errors?
Redis performance monitoring uses INFO command to check memory usage, connected clients, and command statistics. Watch for OOM (Out of Memory) errors by tracking used_memory against maxmemory. Use MONITOR to see real-time commands, or enable slow log with slowlog-log-slower-than. Troubleshoot OOM by reducing maxmemory, adjusting eviction policies (allkeys-lru evicts least-recently-used keys), or scaling to cluster mode. Docker environments require explicit memory limits in compose files. Regular monitoring prevents crashes and identifies bottlenecks.
Can Redis implement pub/sub messaging and queue patterns?
Redis pub/sub enables real-time message broadcasting: PUBLISH sends messages to channels, SUBSCRIBE listens for them. However, pub/sub doesn't persist messages—subscribers must be connected. For durable queues, use lists with LPUSH/RPOP or BLPOP (blocking pop). Redis queues handle job processing, task distribution, and rate limiting. Combine queues with distributed locking for exactly-once processing. Pub/sub suits live notifications; queues suit reliable job execution. Both patterns integrate seamlessly into Redis applications.
SKILL.md
Rendered from the published skill. Quoted content, verbatim.
Redis
Configure, operate, and optimize Redis for caching, queues, rate limiting, and real-time data storage.
When to Use
- You need a low-latency in-memory cache to reduce database load.
- Your application requires rate limiting, session storage, or leaderboards.
- You need pub/sub messaging between services.
- You want a distributed lock or job queue backed by an in-memory store.
Prerequisites
- Linux server or Docker.
- Root or sudo access for package installation.
- Redis 7.x recommended for production.
Installation and Setup
# Debian / Ubuntu
sudo apt update
sudo apt install -y redis-server
# RHEL / Amazon Linux
sudo dnf install -y redis
# Start and enable
sudo systemctl enable --now redis-server
# Verify
redis-cli ping
# Expected output: PONG
Core Configuration
Edit /etc/redis/redis.conf:
```ini
Network
bind 0.0.0.0 port 6379 protected-mode yes requirepass strong_redis_password
Memory
maxmemory
(truncated - see the full file via the links below)
File tree — 1 file
infrastructure/databases/redis/SKILL.md
Let your AI agent find skills like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.
wish › “Set up and configure Redis for caching and data storage”
Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →
Related skills
Master Redis operations across strings, hashes, lists, sets, and sorted sets with real-world examples. Learn persistence strategies, replication setup, and cluster configuration alongside performance monitoring and troubleshooting techniques.
Query Redis cache instances to examine keys, retrieve values, check expiration times, and inspect data structures for troubleshooting. The skill supports both main cache and system cache instances, with read-only operations by default and optional write capabilities for cache management.
Upstash Redis Kv connects to Upstash's Redis-compatible key-value store through a REST interface, enabling you to persist and query data using standard Redis commands. The skill supports all major Redis data structures—strings, hashes, lists, sets, and sorted sets—along with operations like caching, counters, and leaderboards.
AWS S3 equips you with production-grade bucket configuration, from hardening with encryption and public access blocks to enforcing policies and setting up cross-region replication. Handle lifecycle transitions, presigned URLs, and access control in one skill.
Azure AKS provisions managed Kubernetes clusters on Azure with built-in support for node pool configuration, network policies, and auto-scaling. The skill covers cluster creation, ingress setup, Container Insights monitoring, Azure Container Registry integration, and Terraform-based infrastructure as code for repeatable deployments.
This skill teaches Redis data structures—strings, lists, hashes, sets, and sorted sets—along with key management, transactions, and pub/sub messaging. Learn to configure Redis as a data store, execute atomic operations, and build caching solutions for agent workflows.
More skills gpu-server-management (MIT) · redis-patterns (Apache-2.0)