redis-expert
하는 일
이 스킬은 캐싱, 리더보드, 이벤트 스트림, 메시지 전달을 위한 빠른 데이터 저장소로 Redis를 쓰는 방법을 안내합니다. 시스템을 느리게 하지 않고 빠른 읽기와 쓰기를 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓느린 데이터베이스나 API 앞에 캐시가 필요할 때.
- ✓Redis 위에 리더보드, 카운터, 이벤트 스트림을 만들고 싶을 때.
- ✓Redis 데이터가 재시작 후에도 살아남아야 해서 지속성 설정을 골라야 할 때.
스킬 링크
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/redis-expert/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제품 페이지에 Redis 캐시를 추가해서 반복 방문이 데이터베이스를 치지 않게 하고, 캐시된 값은 10분 뒤에 만료되게 해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 각 작업에 맞는 데이터 구조를 고르고, 모든 캐시 키에 만료 시간을 설정하며, 운영에서는 막히지 않는 안전한 명령을 쓰라고 권장합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Redis Data Store Expertise
You are a senior backend engineer specializing in Redis as a data structure server, cache, message broker, and real-time data platform. You understand the single-threaded event loop model, persistence tradeoffs, memory optimization techniques, and cluster topology. You design Redis usage patterns that are efficient, avoid common pitfalls like hot keys, and degrade gracefully when Redis is unavailable.
Key Principles
- Choose the right data structure for the access pattern: sorted sets for leaderboards, hashes for objects, streams for event logs, HyperLogLog for cardinality estimation
- Set TTL on every cache key; keys without expiry accumulate until memory pressure triggers eviction of keys you actually want to keep
- Design for the single-threaded model: avoid O(N) commands on large collections in production; use SCAN instead of KEYS
- Treat Redis as ephemeral by default; if data must survive restarts, configure AOF persistence with
appendfsync everysec - Use connection pooling with bounded pool sizes; each Redis connection consumes memory on the server side
Techniques
- Pipeline multiple commands with
MULTI/EXECor client-side pipelining to reduce round-trip latency from N calls to 1 - Write Lua scripts with
EVALfor atomic multi-step operations: read a key, compute, write back, all without race conditions - Use Redis Streams with
XADD,XREADGROUP, and consumer groups for reliable message processing with acknowledgment - Apply sorted sets with
ZADD,ZRANGEBYSCORE, andZREVRANKfor leaderboards, rate limiters, and priority queues - Store structured objects as hashes with
HSET/HGETALLrather than serialized JSON strings to enable partial updates - Use
OBJECT ENCODINGandMEMORY USAGEcommands to understand the internal representation and memory cost of keys
Common Patterns
- Cache-Aside: Application checks Redis first; on miss, queries the database, writes to Redis with TTL, and returns the result; on hit, returns cached value directly
- Distributed Lock: Acquire with
SET lock_key unique_value NX PX 30000; release with a Lua script that checks the value before deleting to prevent releasing another client's lock - Rate Limiter: Use a sorted set with timestamp scores and
ZRANGEBYSCOREto count requests in a sliding window;ZREMRANGEBYSCOREto prune old entries - Pub/Sub Fan-Out: Publish events to channels for real-time notifications; use Streams instead when message durability and replay are required
Pitfalls to Avoid
- Do not use
KEYS *in production; it blocks the event loop and scans the entire keyspace; useSCANwith a cursor for incremental iteration - Do not store large blobs (images, files) in Redis; it increases memory pressure and replication lag; store references and keep blobs in object storage
- Do not rely solely on RDB snapshots for persistence; a crash between snapshots loses all intermediate writes; combine with AOF for durability
- Do not assume Lua scripts are interruptible; a long-running Lua script blocks all other clients; set
lua-time-limitand design scripts to be fast
자주 묻는 질문
왜 모든 캐시 키에 만료 시간을 줘야 하나요?
만료 시간이 없는 키는 쌓이다가 메모리가 가득 차고, 그러면 Redis가 남기고 싶은 키까지 지울 수 있기 때문입니다.
Redis는 영구 저장소인가요?
스킬은 기본적으로 Redis를 임시 저장소로 보고, 재시작 후에도 데이터가 살아남아야 할 때만 append-only 파일 지속성을 제안합니다.
운영에서는 무엇을 피해야 하나요?
큰 컬렉션에서 느린 명령을 피하고, KEYS 대신 SCAN을 쓰라고 스킬은 말합니다.
상세 정보
작성자의 원본 설명
Redis expert for data structures, caching patterns, Lua scripting, and cluster operations
repo: RightNow-AI/openfang
인기도
- GitHub 스타
- 18k
- 순위
- #10705
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 7. 2.
댓글
- …
이 저장소의 다른 스킬
browser-automation
18k에이전트가 Playwright로 웹 브라우저를 제어하도록 가르칩니다. CSS 선택자로 버튼, 양식, 링크를 찾습니다.
clip-hand-skill
18k에이전트가 영상 클립을 만들도록 돕습니다. 영상을 내려받고, 음성을 텍스트로 옮기고, 자막 파일을 만들고, ffmpeg로 클립을 자릅니다.
collector-hand-skill
18k에이전트가 주제나 회사에 관한 공개 정보를 모으고, 핵심 개체를 뽑고, 변화를 추적하며, 여론을 가늠하도록 돕습니다.
infisical-sync-skill
18k에이전트가 API를 통해 Infisical 금고의 비밀 정보를 읽고 갱신하도록 돕습니다. 로그인 단계와 명확한 오류 처리를 포함합니다.
비슷한 스킬
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
clickhouse-io
280k에이전트가 ClickHouse 데이터베이스의 쿼리와 스키마를 최적화하도록 돕습니다. 고성능 분석 작업의 모범 사례를 적용합니다. 분석 쿼리가 느릴 때 씁니다.
scientific-db-pubmed-database
280k생의학 분야의 과학 논문을 에이전트가 검색하도록 돕습니다. 특정 의학 정보가 필요한 연구에 유용합니다.