DEV Community

Saba Pochkhua
Saba Pochkhua

Posted on

Solving Redis pain in NestJS — introducing nestjs-redis toolkit

Nestjs Redis Logo


Redis is fast, powerful, and battle-tested — but integrating it properly in a NestJS project?

Not so much.

Over the last few projects, I kept hitting the same roadblocks:

  • ❌ No official support for node-redis, the recommended Redis client
  • ❌ Most packages were built on ioredis (now in maintenance-only mode)
  • ❌ Poor support for multi-client setups, async config, and NestJS-style DI
  • ❌ Common utilities like throttling and health checks were scattered, inconsistent, or outdated

So I decided to fix that.

I built nestjs-redis — a modular toolkit of Redis utilities for NestJS, powered by node-redis, tested in real apps, and ready to grow.


✅ What’s in v0.1.0

This is just the beginning, but these 3 modules are already tested and ready to use:

🔌 @nestjs-redis/client

A fully configurable, multi-client Redis module with:

  • Support for single instance, cluster, and sentinel
  • Async config and DI tokens
  • Typed, Nest-style setup for node-redis v5

📈 @nestjs-redis/throttler-storage

Redis-backed rate-limiting for @nestjs/throttler, ready for horizontal scaling.

❤️ @nestjs-redis/health-indicator

Drop-in Redis health check module using @nestjs/terminus.


🧠 Why node-redis?

Most existing packages rely on ioredis, which is no longer recommended for new projects.

“For new projects, node-redis is the recommended client library.”

– from the ioredis maintainers

node-redis is actively maintained, supports Redis 7+, and integrates with Redis Stack, JSON, Streams, and time-series commands.


🔮 Roadmap

Here’s what’s coming next:

  • 🔐 Redlock module — distributed locking via node-redis or Lua
  • 🔁 Redis Streams transporter — a custom microservice transport layer for NestJS

Got suggestions? I’d love to hear what Redis utilities you wish existed in the NestJS world.


🧪 How to Get Started

pnpm add @nestjs-redis/client
pnpm add @nestjs-redis/throttler-storage
pnpm add @nestjs-redis/health-indicator
Enter fullscreen mode Exit fullscreen mode

Or check out the GitHub repo for usage examples:
👉 github.com/CSenshi/nestjs-redis


💬 Your Feedback Shapes the Future

This is just the beginning — nestjs-redis is still in beta, but already running in production-like environments.

If you:

  • Use Redis in your NestJS app
  • Want to get rid of scattered, outdated Redis wrappers
  • Like well-typed, testable, open-source packages
  • Or just want to help improve the Redis ecosystem

👉 I’d love your ideas, issues, contributions, or even just a GitHub ⭐


Thanks for reading 🙏

Let’s make Redis a first-class citizen in the NestJS ecosystem — together.

Top comments (0)