Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@CahidArda
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Jan 23, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a comprehensive set of “skills” documentation for the @upstash/redis JavaScript/TypeScript SDK, covering data structures, patterns, performance, advanced features, and migrations from other Redis clients. The goal is to give developers (and AI assistants) ready-to-use patterns and API examples for common Redis use cases on Upstash.

Changes:

  • Add a top-level skills/SKILL.md index describing the new redis-js skill set and linking to all individual skill files.
  • Add detailed guides for core Redis data structures, advanced features (pipelining, scripting, auto-pipelining), and optimization/performance topics specific to Upstash Redis.
  • Add pattern and migration guides (caching, rate limiting, sessions, locks, leaderboards, and migrations from ioredis and node-redis) with TypeScript examples using @upstash/redis.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
skills/SKILL.md Introduces the redis-js skill, indexing all other skill documents and providing quick-start usage and best practices.
skills/performance/ttl-expiration.md Documents TTL usage and key expiration patterns with @upstash/redis examples.
skills/performance/redis-replicas.md Explains Upstash Redis global replication and when additional read regions help performance.
skills/performance/pipeline-optimization.md Details manual vs auto pipelining, including performance comparisons and batching patterns (one helper example currently misuses the operations callbacks).
skills/performance/error-handling.md Shows retry configuration and request cancellation (AbortSignal) patterns for robust Redis calls.
skills/performance/data-serialization.md Describes automatic (de)serialization behavior and edge cases; includes several examples, though the code block currently reuses the const retrieved identifier in ways that won’t compile.
skills/performance/batching-operations.md Covers batching commands (MGET/MSET, HMGET/HSET, pipelines) for reduced round trips.
skills/patterns/session-management.md Provides session, cart, multi-device, “remember me”, and activity-tracking patterns implemented on Redis.
skills/patterns/rate-limiting.md Implements fixed window, sliding window, token bucket (Lua), and @upstash/ratelimit-based examples, plus per-tier and per-endpoint policies.
skills/patterns/leaderboard.md Shows a full leaderboard pattern on top of sorted sets, including rank context and percentile calculations.
skills/patterns/distributed-locks.md Documents simple locks, token-based safe unlock, retries, and webhook de-duplication using Redis keys.
skills/patterns/caching.md Demonstrates cache-aside, write-through, and cache invalidation flows for a generic database layer.
skills/migrations/from-redis-node.md Guides migration from node-redis to @upstash/redis, comparing connection, commands, serialization, pipelines, and error handling.
skills/migrations/from-ioredis.md Guides migration from ioredis, with side-by-side examples for connection, commands, pipelines, hashes, and a migration checklist.
skills/data-structures/strings.md Documents string usage (including numeric counters, TTLs, and batch operations) using the JS/TS SDK.
skills/data-structures/streams.md Explains stream operations, consumer groups, pending/claim flows, trimming, and a worker example.
skills/data-structures/sorted-sets.md Describes sorted set APIs and patterns such as leaderboards and time-series-like access.
skills/data-structures/sets.md Covers set operations, membership checks, and unions/intersections/differences.
skills/data-structures/lists.md Shows list commands for queues, stacks, trims, and element updates.
skills/data-structures/json.md Details JSON data type usage with path operations, arrays, objects, numeric ops, and type inspection.
skills/data-structures/hashes.md Documents hash usage with field operations; one example comment currently conflicts with other docs about numeric type preservation.
skills/advanced-features/scripting.md Provides Lua scripting examples (conditional updates, rate limiting, purchases) and use of SCRIPT LOAD/EVALSHA.
skills/advanced-features/pipeline-and-transactions.md Explains manual pipelines and MULTI/EXEC transactions in the Upstash client.
skills/advanced-features/auto-pipeline.md Introduces automatic pipelining behavior; mentions enableAutoPipelining but the sample shows only automaticDeserialization, which could confuse readers.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 146 to 150
const start2 = Date.now();
const retrieved = await redis.get("big");
const retrieved = Date.now() - start2;

console.log(`Store: ${stored}ms, Retrieve: ${retrieved}ms`);
Copy link

Copilot AI Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this example code block, the identifier retrieved is declared multiple times as a const (earlier for a class instance, again for the binary value, and here for the performance timing). Re-declaring the same const in the same scope will cause a TypeScript compilation error; consider giving each usage a distinct, descriptive name (e.g., instance, binaryData, retrievedTime) to avoid shadowing and make the examples copy-pasteable.

Copilot uses AI. Check for mistakes.
@CahidArda CahidArda merged commit 2c88e98 into main Jan 23, 2026
14 of 15 checks passed
@CahidArda CahidArda deleted the DX-2363-skills branch January 23, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants