Redis in-memory data structure store commands including key operations, hashes, pub/sub, streams, and clustering.
Install
npx skillscat add jyasuu/cheat-sheet/redis Install via the SkillsCat registry.
SKILL.md
Redis — Key Operations
Basic Commands
redis-cli
SET key "value"
GET key
DEL key
EXPIRE key 60 # TTL in secondsHashes
HSET user:1000 name "John" age 30
HGETALL user:1000Publish/Subscribe
# Terminal 1:
SUBSCRIBE channel
# Terminal 2:
PUBLISH channel "message"Redis — Advanced Patterns
Streams
# Producer:
XADD mystream * sensor-id 1234 temp 19.8
# Consumer:
XREAD BLOCK 0 STREAMS mystream $Lua Scripting
eval "return redis.call('GET', KEYS[1])..ARGV[1]" 1 mykey _suffixCluster Management
redis-cli --cluster create 127.0.0.1:7000 127.0.0.1:7001
redis-cli --cluster check 127.0.0.1:7000