Store tasks in a time-bucketed / priority queue keyed by due time, poll only the tasks due now, and hand them to idempotent workers with at-least-once delivery. Never scan 10M rows every tick — index by fire time so each poll touches only what is due.
Architecture
API ─▶ Task store (DB/Redis ZSET, score = due_ts) ── 10M tasks, sharded
│
Poller (leader per partition) ── ZPOPMIN due<=now ──▶ Ready queue (Kafka)
│ leader election (etcd/ZK) │
▼ ▼
other pollers idle/standby Worker pool (idempotent)
└─ ack ✔ / retry ✖ ─▶ DLQ
