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

Skills เพิ่มเติมจาก redis

docs-sync
redis
วิเคราะห์การใช้งานและการกำหนดค่าในสาขา master เพื่อค้นหาเอกสารที่ขาดหาย ไม่ถูกต้อง หรือล้าสมัยใน 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 ครอบคลุมการออกแบบ schema ของ FT.CREATE การเลือกประเภทฟิลด์ (TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR, JSON path) ไวยากรณ์คำสั่งค้นหา DIALECT 2,…
redis-security
redis
แนวทางความปลอดภัยของ Redis ครอบคลุมการรับรองตัวตน (requirepass และผู้ใช้ ACL), TLS, การควบคุมการเข้าถึงตามสิทธิ์น้อยที่สุดแบบ ACL, การจำกัดการเปิดเผยเครือข่ายผ่าน...
redis-semantic-cache
redis
คำแนะนำ Redis LangCache สำหรับการแคชเชิงความหมายของคำตอบจาก LLM บน Redis Cloud — การเรียกใช้ search/set ผ่าน SDK หรือ REST API การปรับค่าความคล้ายคลึงที่เหมาะสม,…
redis-vector-search
redis
คำแนะนำการค้นหาเวกเตอร์ของ Redis ครอบคลุมการเลือกอัลกอริทึม HNSW กับ FLAT การกำหนดค่าดัชนีเวกเตอร์ (มิติ, หน่วยวัดระยะทาง, ชนิดข้อมูล), การค้นหาแบบไฮบริดแบบกรอง…
bump-test-image
redis
อัปเดตอิมเมจทดสอบ Redis docker เริ่มต้น (redislabs/client-libs-test) ใน DEFAULT_DOCKER_CONFIG ที่ใช้ร่วมกันและ CI matrix จากนั้น force-push …
i18n
redis
ข้อกำหนดการทำสากลสำหรับอินเทอร์เฟซ RedisInsight UI (i18next) ใช้เมื่อเพิ่มหรือแก้ไขสตริงที่ผู้ใช้เห็นภายใต้ redisinsight/ui/** แก้ไข…