02
TL;DRSlow synchronous notifications and timing-out PDF reports → queued, streaming background jobs and Postgres tuned from query plans → the API stopped waiting on side effects.
- Role
- Back-End Developer
- Client
- SimplyDepo · United States
- Year
- 2025—26
- Stack
- Node.js, TypeScript, Express, PostgreSQL
In one paragraph
Turned slow synchronous work into predictable background jobs. Reports that used to time out now run as jobs with progress; notification spikes no longer slow the API; the slowest list endpoints are back within budget.
Context
SimplyDepo is a US order-management platform used by wholesale distributors and their retail customers. I owned backend services on Node.js and PostgreSQL for six months.
Problem
Notification dispatch ran inside request handlers, large PDF reports timed out on the admin side, and a few order-list endpoints got slower every week as data grew.
What I did
- 01
Queue the side effects
Notification dispatch moved behind a job queue with retries, exponential backoff and a dead-letter queue. Endpoints return as soon as the order is saved.
- 02
Stream the documents
Report generation became a streaming background job with progress signals instead of one giant in-memory render that blocked the event loop.
- 03
Tune from the plan, not vibes
Ranked queries by total time in pg_stat_statements, read EXPLAIN (ANALYZE, BUFFERS), added targeted indexes and rewrote N+1 loaders.
- 04
Stable contracts
Versioned REST endpoints for admin tools and integrations, with request validation and one consistent error shape.
Stack
- Node.js
- TypeScript
- Express
- PostgreSQL
- Job queues
- Docker