Backpressure when pipeline is saturated
Why it matters
An ingestion pipeline with no backpressure mechanism is a cost bomb waiting for a large import. A bulk upload of 500,000 contacts from a newly purchased list can exhaust database connection pools, max out queue worker memory, and cause cascading failures in unrelated services sharing the same infrastructure. CWE-400 (Uncontrolled Resource Consumption) applies when there is no ceiling on how fast upstream producers can push work into the pipeline. ISO 25010:2011 §4.2.6 (resource utilization) requires that systems manage resource consumption under load. The fix cost is low; the blast radius of omitting it is high.
Severity rationale
Low because the risk materializes only during atypical high-volume imports, but when it does, an unbound queue can exhaust memory and crash the ingestion pipeline and adjacent services.
Remediation
Configure a concurrency ceiling on queue workers and add a queue-depth check in the producer before enqueuing large batches.
// BullMQ worker — cap concurrent jobs
const worker = new Worker('contact-ingestion', processJob, {
connection,
concurrency: 5, // max 5 jobs in flight simultaneously
})
// Producer — check queue depth before bulk enqueue
const queue = new Queue('contact-ingestion', { connection })
export async function enqueueIfNotSaturated(job: ContactIngestionJob) {
const waiting = await queue.getWaitingCount()
if (waiting > 1000) {
throw new Error(
`Ingestion queue depth is ${waiting} — pipeline is saturated. Retry after current backlog clears.`
)
}
await queue.add('ingest', job)
}
For synchronous ingestion endpoints (no queue), add a rate limit middleware that returns HTTP 429 when request volume exceeds the database's sustainable write throughput.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Data Sourcing & Provenance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- cwe · CWE-400 — Uncontrolled Resource Consumption
- iso-25010:2011 · performance-efficiency.time-behaviour — Performance efficiency — backpressure prevents throughput collapse under load
Taxons
History
- 2026-04-18·v1.0.0·Initial import from data-sourcing-provenance·automated