GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CandoImage/nestjs-redisx: Modular Redis toolkit for NestJS with plugin architecture — caching, locks, rate limiting, idempotency, streams, metrics & tracing

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

52 Commits
52 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.husky
.husky
 
 
apps
apps
 
 
docker
docker
 
 
packages
packages
 
 
scripts
scripts
 
 
website
website
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
eslint.config.mjs
eslint.config.mjs
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
test-results.txt
test-results.txt
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 
vitest.config.ts
vitest.config.ts
 
 
vitest.e2e.config.ts
vitest.e2e.config.ts
 
 
vitest.integration.config.ts
vitest.integration.config.ts
 
 
vitest.load.config.ts
vitest.load.config.ts
 
 
vitest.stress.config.ts
vitest.stress.config.ts
 
 

Repository files navigation

NestJS RedisX

NestJS RedisX

Modular Redis toolkit for NestJS with plugin architecture

npm version npm downloads CI license node version codecov

Documentation • Getting Started • API Reference • Discussions

Who is this for

  • Replace cache-manager with production-grade L1+L2 caching, stampede protection, and tag invalidation
  • Need distributed locks, rate limiting, and idempotency in one ecosystem instead of 5 separate libraries
  • Need Prometheus metrics and OpenTelemetry tracing for Redis operations out of the box
  • Building multi-tenant NestJS apps that need cache isolation per tenant
  • Migrating from raw ioredis/node-redis and want NestJS-native DI integration

Quality

  • 2k+ tests across unit, integration, and E2E
  • Coverage tracked via Codecov
  • Pack-test validates every package installs and works from tarball
  • Compatibility tested across Node 18/20, NestJS 10/11, Redis 6.2/7.x

Testing details | Compatibility matrix

Features

Feature What you get
Cache Two-Tier Cache L1 memory + L2 Redis with anti-stampede, SWR, and tag invalidation
Locks Distributed Locks Redis-based locking with auto-renewal and retry strategies
Rate Limit Rate Limiting Fixed window, sliding window, and token bucket algorithms
Idempotency Request Idempotency Deduplication with fingerprinting and response replay
Streams Redis Streams Consumer groups, dead-letter queues, and backpressure
Metrics Prometheus Metrics Command latencies, cache hit rates, and custom metrics
Tracing OpenTelemetry Tracing Distributed tracing with Jaeger/Zipkin/OTLP export

Quick Start

npm install @nestjs-redisx/core @nestjs-redisx/cache ioredis
import { RedisModule } from '@nestjs-redisx/core';
import { CachePlugin, Cached } from '@nestjs-redisx/cache';
import { ConfigModule, ConfigService } from '@nestjs/config';

// 1. Register
@Module({
  imports: [
    RedisModule.forRootAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      plugins: [
        CachePlugin.registerAsync({
          imports: [ConfigModule],
          inject: [ConfigService],
          useFactory: (config: ConfigService) => ({
            l1: { maxSize: config.get('CACHE_L1_MAX_SIZE', 1000) },
            l2: { defaultTtl: config.get('CACHE_L2_TTL', 3600) },
          }),
        }),
      ],
      useFactory: (config: ConfigService) => ({
        clients: {
          host: config.get('REDIS_HOST', 'localhost'),
          port: config.get('REDIS_PORT', 6379),
        },
      }),
    }),
  ],
})
export class AppModule {}

// 2. Use
@Injectable()
export class UserService {
  @Cached({ key: 'user:{0}', ttl: 300, tags: ['users'] })
  async getUser(id: string) { return this.repo.findById(id); }
}

Plugins

Plugin Description Version
@nestjs-redisx/core Driver abstraction, plugin system, multi-client support npm
@nestjs-redisx/cache L1+L2 caching with SWR, stampede protection, tags npm
@nestjs-redisx/locks Distributed locks with auto-renewal npm
@nestjs-redisx/rate-limit Multi-algorithm rate limiting npm
@nestjs-redisx/idempotency Request deduplication and response replay npm
@nestjs-redisx/streams Redis Streams with consumer groups and DLQ npm
@nestjs-redisx/metrics Prometheus metrics for Redis operations npm
@nestjs-redisx/tracing OpenTelemetry distributed tracing npm

Comparison

RedisX @nestjs/cache-manager @liaoliaots/nestjs-redis ioredis
L1+L2 Cache Yes - - -
Stampede Protection Yes - - -
Distributed Locks Yes - - Manual
Rate Limiting Yes - - -
Idempotency Yes - - -
Prometheus + OTel Yes - - -

Full comparison

Documentation

Full documentation, guides, and API reference at nestjs-redisx.dev.

Sponsors

NestJS RedisX is free and open source. Development is supported by the community.

Become a Sponsor

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

Using with AI Assistants

For better code generation with AI tools (Cursor, Claude Code, GitHub Copilot, etc.), point your agent to the full API reference:

https://nestjs-redisx.dev/llms-full.txt

License

MIT

About

Modular Redis toolkit for NestJS with plugin architecture — caching, locks, rate limiting, idempotency, streams, metrics & tracing

nestjs-redisx.dev

Resources

Readme
License

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.