MR
Mayur Rathi
@sickn33
⭐ 47.3k GitHub stars

redis

redis is an engineering AI skill with a core value of Configure Redis for caching and data storage. It helps developers solve real-world problems in the engineering domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

Configure Redis for caching and data storage. Set up clustering, persistence, and Sentinel. Use when implementing Redis caching or queues.

Last verified on: 2026-10-06

Quick Facts

Category engineering
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 47.3k
Last Verified 2026-10-06
Risk Level Low
mkdir -p ./skills/redis && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/redis/SKILL.md -o ./skills/redis/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# 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


bash
# 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 2gb
maxmemory-policy allkeys-lru

# Connections
maxclients 10000
timeout 300
tcp-keepalive 60

# Logging
loglevel notice
logfile /var/log/redis/redis-server.log

# Security — disable dangerous commands in production
rename-command FLUSHALL ""
rename-command FLUSHDB ""
rename-command CONFIG ""
rename-command DEBUG ""

bash
sudo systemctl restart redis-server

redis-cli Commands Reference


bash
# Connect with authentication
redis-cli -a strong_redis_password

# Connect to a remote host
redis-cli -h 10.0.0.5 -p 6379 -a strong_redis_password

String Operations


text
SET user:1:name "Alice"
GET user:1:name

# Set with TTL (seconds)
SETEX session:abc123 3600 '{"userId":1}'

# Set only if key does not exist (distributed lock pattern)
SET lock:order:42 "worker-1" NX EX 30

# Increment counters
INCR page:views:/home
INCRBY api:quota:user:1 -1

Hash Operations


text
HSET user:1 name "Alice" email "alice@example.com" plan "pro"
HGET user:1 email
HGETALL user:1
HINCRBY user:1 login_count 1

List Operations (Queues)


text
LPUSH queue:emails '{"to":"alice@example.com","subject":"Welcome"}'
RPOP queue:emails
LLEN queue:emails

# Blocking pop (worker pattern)
BRPOP queue:emails 30

Set and Sorted Set Operations


text
# Sets — unique tags
SADD article:1:tags "redis" "database" "caching"
SMEMBERS article:1:tags
SISMEMBER article:1:tags "redis"

# Sorted sets — leaderboards
ZADD leaderboard 1500 "player:1" 2300 "player:2" 1800 "player:3"
ZREVRANGE leaderboard 0 9 WITHSCORES
ZINCRBY leaderboard 100 "player:1"
ZRANK leaderboard "player:2"

Key Management


text
KEYS user:*             # avoid in production — use SCAN instead
SCAN 0 MATCH user:* COUNT 100
TTL session:abc123
PERSIST session:abc123
DEL user:old
EXPIRE user:1 86400
TYPE user:1

Persistence


RDB Snapshots


ini
# redis.conf — save snapshots at intervals
save 900 1       # snapshot if >= 1 key changed in 900 seconds
save 300 10      # snapshot if >= 10 keys changed in 300 seconds
save 60 10000    # snapshot if >= 10000 keys changed in 60 seconds

dbfilename dump.rdb
dir /var/lib/redis
rdbcompression yes

AOF (Append-Only File)


ini
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec    # good balance of safety and performance
# Options: always (safest, slowest), everysec (recommended), no (OS decides)

# AOF rewrite thresholds
auto-aof-rewrite-percentage 100
auto-aof-rewrite-min-size 64mb

Recommended Production Strategy


Use both RDB and AOF together. RDB provides fast restarts and compact backups. AOF provides durability down to 1-second granularity.


ini
save 900 1
save 300 10
appendonly yes
appendfsync everysec

Redis Sentinel (High Availability)


Sentinel monitors Redis instances and performs automatic failover.


Sentinel Configuration


ini
# /etc/redis/sentinel.conf
port 26379
sentinel monitor mymaster 10.0.0.1 6379 2
sentinel auth-pass mymaster strong_redis_password
sentinel down-after-milliseconds mymaster 5000
sentinel fail

🎯 Best For

  • Claude users
  • AI users

💡 Use Cases

  • Using redis in daily workflow
  • Automating repetitive engineering tasks

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply redis to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

How do I install redis?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/redis/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Not reading the full skill

Skills contain important context and edge cases beyond the quick start.

🔗 Related Skills