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.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
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
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
Authentication
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
Client library is Apache 2.0 and free. Redis server is open source (BSD). Redis Cloud and managed offerings have paid tiers.
Agent Metadata
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).
Scores are editorial opinions as of 2026-03-06.