redis-core

작성자: redis

핵심 Redis 모델링 가이드 — 올바른 데이터 구조(String, Hash, List, Set, Sorted Set, JSON, Stream, Vector Set)를 선택하고 일관되게 사용하세요…

npx skills add https://github.com/redis/agent-skills --skill redis-core

Redis Core

Foundational guidance for modeling data in Redis. Covers data-type selection and key-name conventions — the two decisions that most directly drive memory, performance, and maintainability.

When to apply

  • Caching objects, sessions, or per-user state.
  • Counters, leaderboards, recent-items lists, unique-membership sets.
  • Reviewing or refactoring Redis key names.
  • Deciding between a Redis Hash and a JSON document for an entity.

1. Choose the right data structure

Pick the type that matches the access pattern, not just the shape of the data.

Use caseRecommended typeWhy
Simple values, countersStringAtomic INCR/DECR, SET/GET
Object with independently updated fieldsHashPer-field reads/writes, no whole-object rewrite
Queue, recent-N itemsListO(1) push/pop at ends
Unique items, membership checksSetO(1) SADD/SISMEMBER/SCARD
Rankings, score-based rangesSorted SetScore-ordered; ZADD/ZRANGE/ZRANK
Nested / hierarchical dataJSONPath-level updates, nested arrays, RQE indexing
Event log, fan-out messagingStreamPersistent, consumer groups
Vector similarityVector SetNative vector storage with HNSW

Common anti-pattern: stuffing a flat object into a serialized string. Updating one field means fetch + parse + mutate + rewrite. Use a Hash instead.

See references/choose-data-structure.md for full rationale and Python/Java examples.

2. Use consistent key names

Use colon-separated segments with a stable hierarchy:

{entity}:{id}:{attribute}
user:1001:profile
user:1001:settings
order:2024:items
session:abc123
article:987:likes
game:space-invaders:leaderboard

Rules of thumb:

  • Lowercase, colon-separated. No spaces, no mixed casing (User_1001_Profile is bad).
  • Keep keys short but readable — keys live in memory and appear in every command.
  • Don't use full URLs or long strings as keys. Extract a short identifier, or use a hash digest of the URL.
  • Prefix for multi-tenancy (tenant:42:user:7:cart) so scans and ACLs can target a tenant cleanly.
  • Be consistent. Pick one convention per service and apply it across all keys.

See references/key-naming.md for cleanup examples and edge cases.

References

redis의 다른 스킬

docs-sync
redis
마스터 브랜치의 구현 및 구성을 분석하여 docs/, README.md, 패키지별 README에서 누락되거나, 부정확하거나, 오래된 문서를 찾습니다.
redis-query-engine
redis
Redis Query Engine (RQE) 가이드: FT.CREATE 스키마 설계, 필드 유형 선택(TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR), DIALECT 2 쿼리 구문,…
redis-search
redis
Redis Search 가이드: FT.CREATE 스키마 설계, 필드 유형 선택(TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR, JSON 경로), DIALECT 2 쿼리 구문,…
redis-security
redis
Redis 보안 가이드로 인증(requirepass 및 ACL 사용자), TLS, ACL 기반 최소 권한 접근 제어, 네트워크 노출 제한 등을 다룹니다.
redis-semantic-cache
redis
Redis LangCache를 사용하여 Redis Cloud에서 LLM 응답의 시맨틱 캐싱을 수행하는 방법 — SDK 또는 REST API를 통한 검색/설정 호출, 유사도 임계값 조정,…
redis-vector-search
redis
Redis 벡터 검색 가이드: HNSW vs FLAT 알고리즘 선택, 벡터 인덱스 구성(차원, 거리 메트릭, 데이터 타입), 필터링된 하이브리드 검색…
bump-test-image
redis
공유 DEFAULT_DOCKER_CONFIG 및 CI 매트릭스에서 기본 Redis docker 테스트 이미지(redislabs/client-libs-test)를 범프한 다음 강제 푸시합니다…
i18n
redis
RedisInsight UI(i18next)의 국제화 규칙입니다. redisinsight/ui/** 아래의 사용자 표시 문자열을 추가하거나 변경할 때, ...를 편집할 때 사용합니다.