Backend job queue
A production-style async job system in TypeScript — Express API, Postgres-backed job store, Redis coordination, and workers with leases, heartbeats, idempotency, and a dead-letter queue.
The problem
Background jobs are where backends quietly break: workers die mid-task and leave work stuck, retries process the same job twice, and failures go unnoticed until customers complain.
What I built
A TypeScript job system built for failure from the start. An Express API enqueues jobs into a PostgreSQL-backed store; Redis coordinates a pool of workers that claim work with leases and heartbeats, so no job stays stuck on a dead worker. Idempotency keys and fencing tokens make retries safe to re-run; poisoned jobs land in a dead-letter queue with manual retry. Prometheus metrics and Grafana dashboards expose throughput and failure rates, everything runs via docker-compose, and load-test scripts verify behavior under pressure.
Results