NestJS RedisX Guide
Welcome to the NestJS RedisX Guide. This section explains why and when to use each feature, helping you make informed architectural decisions.
Philosophy
NestJS RedisX is built on three principles:
- Declarative over Imperative — Use decorators instead of boilerplate
- Sensible Defaults — Works out of the box, customizable when needed
- Observable by Design — Built-in metrics and tracing
What RedisX Provides
| Plugin | Purpose | Use When |
|---|---|---|
| Cache | Two-tier caching (L1 + L2) | Reducing database load |
| Locks | Distributed mutual exclusion | Preventing race conditions |
| Rate Limit | Request throttling | Protecting APIs from abuse |
| Idempotency | Duplicate request handling | Payment/order processing |
| Streams | Event streaming with consumer groups | Background job processing |
| Metrics | Prometheus metrics | Production monitoring |
| Tracing | OpenTelemetry integration | Distributed tracing |
Guide Structure
For Quick Decisions
- Decision Guide — Which plugin do I need?
For Understanding (Concepts)
- Two-Tier Caching — L1/L2 architecture
- Distributed Coordination — Locks vs Idempotency
- Rate Limiting Strategies — Algorithm selection
- Event Streaming — Streams vs alternatives
- Observability Strategy — What to monitor
For Designing (Architecture)
- Key Naming — Naming conventions
- Multi-Tenancy — Tenant isolation
- Guarantees — What is and isn't guaranteed
- Failure Modes — Graceful degradation
- Deployment — Topology selection
- Security — TLS, ACL, data classification
For Building (Recipes)
- Payment Processing — Prevent double charges
- Webhook Delivery — Reliable webhook handling
- Login Throttling — Brute force protection
- Background Jobs — Async processing
- Session Management — Distributed sessions
For Integrating
For Operating
- Monitoring — Dashboards and SLOs
- Alerting — Alert configuration
- Runbooks — Incident response
For Troubleshooting
Next Steps
New to RedisX? Start here:
- Installation — Add packages to your project
- Quick Start — Basic usage in 5 minutes
- Decision Guide — Choose the right plugins