Scores on the Board

You need delayed jobs on Redis with delays ranging from 5 seconds to 30 days, at a few thousand enqueues per second. Which design holds up?

A

Keep one list per second of wall-clock time for the next 30 days and have the poller read only the list named for the current second

B

Store job ids in a sorted set scored by due timestamp, and run a small poller that atomically moves entries scored at or below now into the ready queue

C

Set a key whose TTL equals the delay and dispatch the job from the keyspace expiry notification that Redis publishes when the key expires, with one subscriber per worker

D

Push every job onto the ready list immediately and have the consuming worker sleep until the due time before it starts processing the payload