Redis
Designs, tunes, and debugs Redis: data structures, memory limits, persistence, Streams and queues, locks, replication, and cluster. Use when writing Redis…
от clawic★ 23 звезды на GitHub
Установить Redis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
User preferences and memory live in ~/Clawic/data/redis-store/ (see setup.md on first use, memory-template.md for the file format). If you have data at an old location (~/redis-store/ or ~/clawic/redis-store/), move it to ~/Clawic/data/redis-store/, and say in one line that you moved it and from where.
When To Use
- Choosing how to model something in Redis: hash vs JSON string vs separate keys, sorted set vs stream, set vs bitmap vs HyperLogLog
- Writing Redis commands, pipelines, Lua scripts or Functions, and getting atomicity right
- Building the standard recipes: cache, session store, job queue, distributed lock, rate limiter, leaderboard, dedup/idempotency key, counter
- Operating a server: maxmemory and eviction, persistence and backups, ACLs, connection limits, replication, Sentinel, Cluster
- A production incident: OOM on writes, latency spike, unresponsive server, keyspace evicted or wiped, failover that lost writes, replica that never syncs
- Migrating: standalone to cluster, version upgrade, a managed provider (ElastiCache, MemoryDB, Redis Cloud, Upstash, Memorystore, Azure) or the Valkey fork
- Not for store-agnostic cache hierarchy design (caching), rate-limit algorithm selection (rate-limiting), or relational modeling (pg, sql)
Quick Reference
| Situation | Play |
|---|---|
Writes fail with OOM command not allowed |
maxmemory reached under noeviction (the default policy) — Expiration And Eviction, then memory-eviction.md |
| Memory grows forever, hit rate fine | Keys written without a TTL, or a stream nobody trims (→ memory-eviction.md, queues.md) |
| Keys disappear before their TTL | Eviction, not expiry: check evicted_keys in INFO stats (→ memory-eviction.md) |
| Keys never expire | A plain SET on an existing key clears its TTL — use SET ... KEEPTTL (Redis >=6.0) or re-set it (→ keys-ttl.md) |
| Server froze for seconds | An O(N) command on a big collection, a fork, or swap — Latency Triage |
| Need to walk the keyspace | SCAN cursor loop with COUNT 500, never KEYS (→ cli.md) |
| Which structure for this data | Choosing The Data Structure |
| Job queue with retries and acks | Stream + consumer group; a List only for fire-and-forget (→ queues.md) |
| Subscribers miss messages sent while down | Pub/Sub is at-most-once and stores nothing — move to Streams (→ pubsub.md) |
| Two workers must not run at once | SET lock <token> NX EX <ttl> + Lua release comparing the token (→ locks.md) |
| Read-modify-write race | One atomic command or one Lua script; MULTI is not a rollback (→ scripting.md) |
CROSSSLOT keys ... don't hash to the same slot |
Hash-tag the related keys: {user:1}:profile (→ cluster.md) |
MOVED / ASK reaching the app |
Client is not cluster-aware, or its slot map is stale (→ cluster.md) |
MISCONF ... unable to persist to disk |
The last background save failed; writes are refused on purpose (→ persistence.md) |
| Writes acknowledged then lost after failover | Replication is asynchronous by default — WAIT, min-replicas-to-write (→ high-availability.md) |
| Latency spike with no CPU load | Fork for RDB/AOF rewrite, transparent huge pages, or swap (→ performance.md) |
| Throughput far below 10^5 ops/s | Round trips, not Redis: pipeline or use multi-key commands (→ performance.md) |
| Everything recomputes at once after a deploy or restart | Cache stampede: TTL jitter + single-flight recompute (→ caching.md) |
| Instance was reachable from the internet | Treat as compromised, then bind, ACL, TLS (→ security.md) |
Provider rejects CONFIG SET, DEBUG, SHUTDOWN |
Managed capability matrix (→ managed-redis.md) |
| Tests are flaky or slow around Redis | Real server in a container, unique prefix per test, no shared FLUSHDB (→ testing.md) |
| Anything else | INFO, SLOWLOG GET 10, LATENCY DOCTOR, MEMORY DOCTOR before changing anything; reproduce in redis-cli before blaming the client library |
Depth on demand, by phase:
- Model —
data-types.mdwhich structure wins and what it costs ·keys-ttl.mdkey design, expiry semantics, SCAN, keyspace notifications ·patterns.mdsessions, leaderboards, counters, dedup, autocomplete, geo ·modules.mdJSON, Search, vectors, Bloom, TimeSeries - Build —
caching.mdcache-aside, invalidation, stampede, client-side caching ·queues.mdStreams, consumer groups, retries, delayed jobs ·pubsub.mdfan-out, sharded Pub/Sub, notifications ·locks.mddistributed locks and fencing ·scripting.mdatomicity, MULTI, Lua, Functions ·testing.mdtest isolation and CI - Operate —
memory-eviction.mdmaxmemory, eviction, big keys, fragmentation ·persistence.mdRDB, AOF, backups, restore drills ·connections.mdpooling, timeouts, buffers, TLS ·security.mdACLs, exposure, command policy ·cli.mdthe redis-cli forensics toolkit ·managed-redis.mdElastiCache, MemoryDB, Redis Cloud, Upstash, Memorystore, Azure - **Scale
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- _meta.json
- caching.md
- cli.md
- cluster.md
- connections.md
- data-types.md
- high-availability.md
- incidents.md
- keys-ttl.md
- locks.md
- managed-redis.md
- memory-eviction.md
- memory-template.md
- migrations.md
- modules.md
- patterns.md
- performance.md
- persistence.md
- pubsub.md
- queues.md
- scripting.md
- security.md
- setup.md
- testing.md
FAQ
Что делает скилл Redis?
Designs, tunes, and debugs Redis: data structures, memory limits, persistence, Streams and queues, locks, replication, and cluster. Use when writing Redis commands or Lua, choosing between a hash, a sorted set and a stream, setting expirations on cache keys, building a queue, distributed lock, rate limiter, leaderboard, session store or counter, or when Redis answers OOM, MISCONF, CROSSSLOT, MOVED, BUSY, LOADING or WRONGTYPE, latency spikes, memory keeps growing, keys vanish early or never expire, a replica lags or a failover loses writes, KEYS or a big DEL freezes the server, connections are refused, or a cluster reshard, a Valkey / ElastiCache / MemoryDB / Upstash move, or a persistence and backup plan is on the table. Covers redis-cli forensics, pipelining, eviction policies, keyspace notifications, ACLs and exposed-instance hardening, and the JSON, Search and TimeSeries modules. Not for store-agnostic cache hierarchy strategy (caching) or picking a rate-limit algorithm (rate-limiting).
Как установить скилл Redis?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Redis запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…