$npx skillfedfor your agent

redis

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.

Redis helps you master database commands, data structures, and cluster management through practical terminal examples.

AI-generated summary based on this skill's SKILL.md

50 12 Apache-2.0updated by chaterm

Decision gist · record as of 2026-03-03

Redis helps you master database commands, data structures, and cluster management through practical terminal examples. 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.

manual: git clone https://github.com/chaterm/terminal-skills → cp -r terminal-skills/database/redis ~/.claude/skills/redis
database/redis/SKILL.md · version 44abd153

Use it when

  • Redis offers two persistence mechanisms.
  • Redis master-slave replication synchronizes data across instances.

Verify before relying

Read SKILL.md below before installing (1 file). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

chaterm/terminal-skills/redis

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

What are the main Redis data structures and how do I use Redis commands?

Redis supports five core data structures: strings, hashes, lists, sets, and sorted sets. Strings store simple key-value pairs using GET/SET commands. Hashes organize related fields with HGET/HSET. Lists maintain ordered elements via LPUSH/RPUSH. Sets store unique values with SADD/SMEMBERS. Sorted sets combine uniqueness with scoring using ZADD/ZRANGE. Each structure has specialized commands optimized for different access patterns and use cases.

How do I configure redis persistence with RDB and AOF?

Redis offers two persistence mechanisms. RDB (Redis Database) creates point-in-time snapshots at intervals or after a set number of writes—fast but may lose recent data. AOF (Append-Only File) logs every write operation, providing better durability but larger file sizes. Configure both in redis.conf: set 'save' directives for RDB snapshots and 'appendonly yes' for AOF. Combine them for maximum safety: RDB for recovery speed, AOF for data loss prevention.

What's the process for setting up redis master slave replication?

Redis master-slave replication synchronizes data across instances. On the slave, execute SLAVEOF master_ip master_port or configure 'slaveof' in redis.conf. The slave connects to the master, performs an initial full sync (PSYNC), then receives incremental updates. Use ROLE command to verify replication status. For high availability, combine replication with Sentinel to auto-failover if the master fails.

How can I implement redis distributed lock implementation for concurrency?

Redis distributed locks prevent concurrent access to shared resources. Set a lock key with SET key value NX EX seconds—NX ensures atomicity (only succeeds if absent), EX sets expiration to prevent deadlocks. Use a unique value (UUID) to safely delete only your lock. For complex scenarios, use Redlock algorithm across multiple Redis instances. Monitor lock contention and adjust TTL based on operation duration.

What techniques help with redis performance monitoring and troubleshooting?

Redis provides multiple monitoring tools. SLOWLOG GET captures slow commands exceeding a threshold (slowlog-max-len in config). INFO command returns memory, CPU, and replication stats. MONITOR shows real-time commands. Use redis-cli --stat for live metrics. For memory issues, MEMORY DOCTOR analyzes usage patterns. CLIENT LIST tracks connections. Enable slow query logging, set appropriate timeouts, and regularly analyze INFO output to detect bottlenecks early.

How do I detect and optimize big keys in redis?

Big keys consume excessive memory and slow operations. Detect them using redis-cli --bigkeys for a quick scan, or MEMORY DOCTOR for detailed analysis. Use STRLEN for strings, HLEN for hashes, LLEN for lists to measure sizes. Optimize by splitting large hashes into smaller ones, sharding big lists across keys, or compressing values. Monitor key sizes regularly and set alerts for anomalies to prevent performance degradation.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.

Redis 数据库管理

概述

Redis 命令、持久化、集群配置等技能。

连接管理

# 本地连接
redis-cli

# 远程连接
redis-cli -h hostname -p 6379
redis-cli -h hostname -p 6379 -a password

# 连接并选择数据库
redis-cli -n 1

# 执行单条命令
redis-cli ping
redis-cli get key

# 集群连接
redis-cli -c -h hostname -p 6379

基础命令

键操作
# 查看键
KEYS *                              # 所有键(生产慎用)
KEYS user:*                         # 匹配模式
SCAN 0 MATCH user:* COUNT 100       # 安全遍历

# 键信息
EXISTS key
TYPE key
TTL key                             # 剩余过期时间
PTTL key                            # 毫秒

# 键操作
DEL key
EXPIRE key 3600                     # 设置过期时间
PERSIST key                         # 移除过期时间
RENAME key newkey
字符串
SET key value
SET key value EX 3600               # 带过期时间
SETNX key value                     # 不存在时设置
GET key
MSET key1 val1 key2 val2
MGET key1 key2
INCR counter
INCRBY counter 10
DECR counter
APPEND key " suffix"
STRLEN key
哈希

```bash HSET user:1 name "John" age 30 HGET user:1 name HMSET user:1 name "John" age 30 HMGET user:1 name age HGETALL user:1 HDEL

(truncated - see the full file via the links below)

File tree — 1 file
database/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 › “Learn Redis commands and data structure operations”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

redis
by BagelHole · BagelHole/DevOps-Security-Agent-Skills

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.

MITupdated May 2026
★ 44repo stars
redis-inspect
by civitai · civitai/civitai

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.

Apache-2.0for claude-codeupdated Jul 2026
★ 7,201repo stars
Upstash Redis Kv
by intellectronica · intellectronica/agent-skills

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.

CC0-1.0updated Apr 2026
★ 279repo stars
Redis
by pluginagentmarketplace · pluginagentmarketplace/custom-plugin-sql

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.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
vpn
by chaterm · chaterm/terminal-skills

This skill covers setup and administration for three major VPN protocols: WireGuard, OpenVPN, and IPSec via strongSwan. Learn installation steps, certificate and key generation, server and client configuration, and practical scenarios like site-to-site tunnels and split routing.

Apache-2.0docs in Chineseupdated Mar 2026
★ 50repo stars
file-operations
by chaterm · chaterm/terminal-skills

file-operations covers essential Linux file system tasks: searching by name, type, size, or modification time; performing batch operations like rename and delete; and managing permissions and ownership. It includes practical scenarios for cleanup, finding recent changes, and bulk content replacement.

Apache-2.0updated Mar 2026
★ 50repo stars

More skills RedBookSkills (MIT)

Tags
in-memory-storedistributed-cachingsession-managementqueue-processingreal-time-analyticshigh-availabilitydata-persistencecluster-orchestration