When to Use
UseRedisStorageAdapter when:
- Running multiple pods/instances
- You need shared cache across the cluster
- You want TTL-based cache expiration
Configuration
src/storage/redis-adapter.ts
Options
| Option | Type | Default | Description |
|---|---|---|---|
client | Redis | required | ioredis client instance |
namespace | string | 'default' | Namespace for isolation |
ttl | number | 86400 | Time-to-live in seconds |
keyPrefix | string | 'vectoriadb' | Redis key prefix |
Redis Client
Any Redis client with this interface works:src/redis-interface.ts
With ioredis
src/ioredis.ts
With redis
src/node-redis.ts
TTL Configuration
Set TTL based on your cache invalidation strategy:src/redis-ttl.ts
Redis Key Structure
The adapter creates keys like:{keyPrefix}:{namespace}
Multi-Tenant Setup
src/redis-multi-tenant.ts
Connection Handling
The adapter doesn’t manage the Redis connection lifecycle:src/redis-lifecycle.ts
Error Handling
src/redis-errors.ts
Related
Storage Overview
Storage fundamentals
File Adapter
Single-server storage
Deployment
Docker setup