Skip to content

Redis

Used for By
Cache (CacheService) nest-api cache
Rate-limit buckets (app routes and /auth) nest-api rate-limit
BullMQ queues nest-api queue, node-worker, py-worker
Socket.IO fan-out and presence nest-api realtime

Every template reads REDIS_HOST, REDIS_PORT, REDIS_USER and REDIS_PASSWORD.

yarn dc:up in the API starts Redis 7 on 6379 (no password, no persistence). Tests use a separate one on 6399.

  • Persistence on (AOF or RDB): queued jobs live in Redis. A restart without persistence loses every waiting job.
  • maxmemory-policy noeviction, which BullMQ requires: an evicted key can corrupt a queue.
  • One Redis for the API and its workers, with identical REDIS_* everywhere. A worker on a different Redis connects fine and never receives a job.
  • An ACL user: set REDIS_USER and REDIS_PASSWORD (both are honoured by every template).