You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A distributed job queue system built with Node.js, TypeScript, Redis (BullMQ), and PostgreSQL. Features horizontal worker scaling, retry with exponential backoff, job scheduling, priority queues, and a real-time monitoring dashboard.
Processes jobs from queues (horizontally scalable)
Scheduler
cron-parser
Runs scheduled/recurring jobs
Dashboard
Next.js 15 + Tailwind
Real-time monitoring UI
Queue Broker
Redis 7 + BullMQ
Job delivery, priority, retry mechanics
Database
PostgreSQL 16 + Drizzle
Durable job state, audit trail
Design Decisions
Dual storage: Redis handles fast job delivery and retry mechanics. PostgreSQL stores the durable audit trail for querying and dashboards.
Competing consumers: Workers atomically dequeue jobs from BullMQ. Multiple workers on the same queue share the workload. Scale by adding more worker containers.
Exponential backoff: Failed jobs retry with delay = 1000ms * 2^attempt with jitter. After max retries, jobs move to "dead" status.
SWR polling: The dashboard uses SWR with 3-5 second polling intervals for near-real-time updates without WebSocket complexity.
Dead letter: After max retries exhausted, status becomes dead
Manual retry: POST /api/v1/jobs/:id/retry resets attempts and re-enqueues
Horizontal Scaling
Workers are stateless competing consumers. Scale by running more worker instances:
# Docker Compose
docker compose up --scale worker=5 -d
# Or run multiple worker processes locally
WORKER_CONCURRENCY=10 npm run dev --workspace=@taskflow/worker
Distributed job queue system built with Node.js, TypeScript, BullMQ (Redis), and PostgreSQL. Features horizontal worker scaling, retry with exponential backoff, cron scheduling, priority queues, and a real-time Next.js monitoring dashboard.