node-redis (redis npm package)

Official Redis client for Node.js (the redis npm package, v4+). Modern async/await API with TypeScript support, auto-pipelining, connection pooling, Cluster/Sentinel support, and full coverage of Redis commands. v4 was a complete rewrite from the callback-based v3 API to native async/await. Competes with ioredis; both are popular. redis v4+ is the official client from Redis Labs.

Evaluated Mar 06, 2026 (0d ago) v4.x
Homepage ↗ Repo ↗ Developer Tools redis cache node typescript async pub-sub streams official
⚙ Agent Friendliness
65
/ 100
Can an agent use this?
🔒 Security
83
/ 100
Is it safe for agents?
⚡ Reliability
85
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
85
Auth Simplicity
85
Rate Limits
88

🔒 Security

TLS Enforcement
85
Auth Strength
82
Scope Granularity
78
Dep. Hygiene
90
Secret Handling
82

TLS configurable but not default. AUTH password required for secured Redis. ACL for fine-grained command permissions in Redis 6+. Don't expose Redis publicly without auth and network restrictions.

⚡ Reliability

Uptime/SLA
88
Version Stability
85
Breaking Changes
80
Error Recovery
88
AF Security Reliability

Best When

You need an official, well-maintained Redis client for Node.js with modern async/await API, TypeScript support, and full Redis feature coverage.

Avoid When

You prefer ioredis (both are excellent — choice is often team preference or existing codebase), or need Redis access from non-Node.js code.

Use Cases

  • Implement caching layers in Node.js applications using GET/SET/SETEX commands with TTL-based expiration
  • Pub/Sub messaging between Node.js microservices using Redis PUBLISH/SUBSCRIBE for event-driven architectures
  • Store and retrieve session data in Redis from express-session via connect-redis adapter
  • Implement distributed rate limiting using Redis atomic operations (INCR, EXPIRE) in Node.js APIs
  • Use Redis Streams for event sourcing or as a lightweight message queue in agent workflow pipelines

Not For

  • Persistent primary data storage — Redis is in-memory; use PostgreSQL or MongoDB for durable primary storage
  • Complex relational queries — Redis is a key-value/data structure store; use SQL databases for relational data
  • Non-Node.js Redis access — use ioredis as alternative client; same Redis, different client API preferences

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: password acl
OAuth: No Scopes: Yes

Redis AUTH command via password in connection config. Redis 6+ ACL for user-based access control. TLS via socket option. Upstash Redis also supported via URL.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Client library is Apache 2.0 and free. Redis server is open source (BSD). Redis Cloud and managed offerings have paid tiers.

Agent Metadata

Pagination
cursor
Idempotent
Partial
Retry Guidance
Documented

Known Gotchas

  • redis v4 is a complete async rewrite from v3 — callback-based v3 code must be converted to async/await; mixing v3/v4 patterns causes confusion when migrating
  • createClient() doesn't auto-connect in v4 — must call await client.connect() explicitly before first command; missing this throws 'client is closed' errors
  • Subscriber clients cannot issue commands — a SUBSCRIBE client can only do pub/sub commands; create a separate client for regular commands when also using pub/sub
  • TLS requires explicit socket configuration — cloud Redis (Upstash, Heroku Redis) requires tls: {} option; missing TLS causes connection failures on TLS-required hosts
  • Auto-pipelining batches concurrent commands automatically — commands sent in the same event loop tick are pipelined for efficiency; explicitly use multi() for transactional command batching
  • Key expiration is passive/lazy — expired keys persist in memory until accessed or evicted; don't rely on TTL for real-time cleanup without enabling active expiry configuration

Alternatives

Full Evaluation Report

Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for node-redis (redis npm package).

$99

Scores are editorial opinions as of 2026-03-06.

5215
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered