Transactional email and SMS
Sign-up, receipt and reset messages are queued by the web app and sent by a pool of workers.
FIFO queues that do not lose jobs when a worker dies, with producers and consumers running in parallel.
Any service adds work without waiting for consumers.
An animated walkthrough with real HotKV commands and example replies. Click any step to jump to it.
Background work such as emails, image resizing and webhooks needs a queue between the code that creates it and the code that does it. A queue that loses a job when a worker crashes mid-task is worse than no queue, because nobody notices the job is gone.
Lists give you a simple FIFO queue. BLMOVE moves each job onto a processing list as it is handed to a worker, so an in-progress job is always stored somewhere if that worker disappears. Producers and consumers are served by parallel worker threads.
Any service adds work without waiting for consumers.
LPUSH queue:emails "{\"to\":\"ada@example.com\",\"tpl\":\"welcome\"}"BLMOVE blocks until a job is available, then moves it to a processing list in one step.
BLMOVE queue:emails queue:emails:processing RIGHT LEFT 0The email went out. The job is removed from the processing list.
LREM queue:emails:processing 1 "{\"to\":\"ada@example.com\",\"tpl\":\"welcome\"}"Worker 2 dies mid-job. Its job is still in the processing list, not lost.
LRANGE queue:emails:processing 0 -1A monitor moves the abandoned job back to the queue and another worker picks it up.
LMOVE queue:emails:processing queue:emails LEFT RIGHTSign-up, receipt and reset messages are queued by the web app and sent by a pool of workers.
Uploads are queued for thumbnailing and transcoding, and a crashed transcoder never drops a file.
Outgoing webhooks are queued and retried without blocking the request that triggered them.
LPUSH with BRPOP, and workers sleep until work arrives.
LPUSHBRPOPBLMOVE hands each job to a processing list atomically.
BLMOVELREMProducers and consumers are served by parallel worker threads.
For acknowledgements, consumer groups and replay, use streams.
XADDXREADGROUPIf you claim jobs with BLMOVE, the job sits in the processing list. A monitor can move anything that has been there too long back onto the queue.
No. BRPOP and BLMOVE block until a job arrives, with an optional timeout.
Lists are the simplest queue. Streams add consumer groups, per-message acknowledgement and history. See the event streaming use case.
HotKV speaks the Redis protocol, so you can point an existing client at it and run these same commands.