Node.jsInterview preparation
Intermediate·Concept·2 min read

When should I use a queue or Redis?

Practice this question

Definition:

A queue stores work to be processed separately from the request that created it. Redis is an in-memory data store often used for caching, counters and some queue implementations, with persistence and availability depending on configuration. They solve different problems and should be chosen from the required data-loss and recovery guarantees.

Key points:

  • Use a queue for slow work that can finish after the response.

  • Use Redis for short-lived cached data or shared rate-limit counters.

  • Define retries, expiry and duplicate handling; neither tool removes failure cases.

  • Monitor queue age as well as length, and define what users see while work is pending or failed.

Interview point:

  • Returning 202 for accepted background work means it was accepted, not that the business action has completed.
Adapted from 02_NODE_EXPRESS_HTTP.md · “When should I use a queue or Redis?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.