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 की और Skills

docs-sync
redis
मास्टर ब्रांच के कार्यान्वयन और कॉन्फ़िगरेशन का विश्लेषण करें ताकि docs/, README.md, और प्रति-पैकेज README में गायब, गलत, या पुराने दस्तावेज़ का पता लगाया जा सके। उपयोग करें…
official
implement-command
redis
Add a new Redis command (or command variant) to node-redis end-to-end — the `<NAME>.ts` Command file, its registration with JSDoc in the package…
official
maintainer-review
redis
GitHub issue या pull request URL की समीक्षा node-redis अनुरक्षक के रूप में करें, जिसमें यह चरणबद्ध मूल्यांकन हो कि दावा वास्तविक है, व्यावहारिक रूप से महत्वपूर्ण है, पहले से...
official
pr-draft-summary
redis
node-redis के लिए आवश्यक PR-तैयार सारांश ब्लॉक, शाखा सुझाव, शीर्षक और ड्राफ्ट विवरण बनाएं। इसका उपयोग अंतिम प्रतिक्रिया से पहले किया जाना चाहिए जब भी...
official
runtime-behavior-probe
redis
रनटाइम व्यवहार जांच की योजना बनाएं और अस्थायी TypeScript प्रोब स्क्रिप्ट, सत्यापन मैट्रिक्स, स्थिति नियंत्रण और निष्कर्ष-प्रथम रिपोर्ट के साथ उन्हें क्रियान्वित करें। उपयोग करें…
official
backend
redis
NestJS बैकएंड विकास पैटर्न RedisInsight API के लिए: मॉड्यूल संरचना, सेवाएँ, नियंत्रक, DTO, निर्भरता इंजेक्शन, और त्रुटि प्रबंधन। उपयोग करें जब...
official
branches
redis
लोअरकेस केबब-केस का उपयोग करें, जिसमें टाइप प्रीफिक्स और इश्यू/टिकट आइडेंटिफायर हो। ब्रांच नाम GitHub Actions वर्कफ़्लो नियमों से मेल खाने चाहिए (.github/workflows/enforce-branch-name-rules.yml देखें)।
official
code-quality
redis
Code-quality standards for RedisInsight: TypeScript strictness, naming conventions (camelCase, PascalCase, UPPER_SNAKE_CASE), linting rules, no `any` without…
official