Copied
ADR-010 · apps/workers · Ratified

ADR-010: Background Worker Daemon Isolation from Web Runtime

Offload NATS JetStream consumers, BullMQ queues, Sharp image encoding, and BoQ PDF compilation to a standalone Node.js 24 daemon.

← All ADRs · Gate: Package dependency boundaries + container liveness probe

Context

Running CPU-heavy Sharp WebP/Blurhash generation, PDF generation, or long-lived NATS/Redis TCP consumers inside serverless web instances causes thread starvation and cold-start timeouts.

Decision

Isolate all asynchronous consumers and BullMQ workers into apps/workers running on Node.js 24 Alpine containers with an HTTP liveness probe.

Consequences

Web p95 latency remains predictable under heavy media upload or regulator retry spikes.