redis
यह क्या करती है
Redis एक ऐसा सिस्टम है जो जानकारी को कंप्यूटर की memory में तेज़ी से स्टोर करता है। इसका इस्तेमाल डेटा को तेज़ी से access करने, task queues संभालने और real-time डेटा स्टोर करने के लिए होता है।
कब इस्तेमाल करें
- ✓जब आपकी website को database पर ज़्यादा बोझ डाले बिना तेज़ी से load होना हो।
- ✓किसी यूज़र को एक तय समय में कोई action कितनी बार करने दिया जाए, यह कंट्रोल करने के लिए (rate limiting)।
- ✓सिस्टम के अलग-अलग हिस्सों के बीच तुरंत messages भेजने के लिए।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/redis/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“Redis सेट करो ताकि यूज़र का डेटा स्टोर हो और website तेज़ चले।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
Redis डेटा को key-value pairs में स्टोर करता है, बिलकुल dictionary की तरह। इससे डेटा जोड़ना, निकालना और हटाना बहुत तेज़ी से होता है। डेटा खोने से बचाने के लिए इसे समय-समय पर disk पर भी सेव किया जा सकता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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:
# 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 ""
sudo systemctl restart redis-server
redis-cli Commands Reference
# 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
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
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)
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
# 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
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
# 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)
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.
save 900 1
save 300 10
appendonly yes
appendfsync everysec
Redis Sentinel (High Availability)
Sentinel monitors Redis instances and performs automatic failover.
Sentinel Configuration
# /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 failover-timeout mymaster 60000
sentinel parallel-syncs mymaster 1
Run at least three Sentinel instances for quorum.
# Start Sentinel
redis-sentinel /etc/redis/sentinel.conf
# Query Sentinel
redis-cli -p 26379 SENTINEL masters
redis-cli -p 26379 SENTINEL get-master-addr-by-name mymaster
redis-cli -p 26379 SENTINEL replicas mymaster
Redis Cluster Mode
Cluster mode distributes data across multiple shards automatically.
…
अक्सर पूछे जाने वाले सवाल
Redis इस्तेमाल करने के लिए क्या मुझे कोई खास server चाहिए?
ज़रूरी नहीं। Redis को किसी सामान्य Linux server पर install किया जा सकता है, या Docker जैसे containers का इस्तेमाल किया जा सकता है।
क्या Redis सुरक्षित है?
हाँ, इसे passwords से सुरक्षित किया जा सकता है और इस तरह configure किया जा सकता है कि production में खतरनाक commands इस्तेमाल न हो सकें।
'caching' क्या होता है?
Caching का मतलब है बार-बार इस्तेमाल होने वाली जानकारी की copy किसी तेज़ जगह पर रखना, ताकि हर बार उसे original source (जैसे database) से न लाना पड़े। इससे सब कुछ तेज़ हो जाता है।
जानकारी
लेखक का मूल विवरण
Configure Redis for caching and data storage. Set up clustering, persistence, and Sentinel. Use when implementing Redis caching or queues.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5599
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।