DBRaven
Post-Mortem Framework · Capacity: Queue Backlog Accumulation

Queue Backlog Accumulation

SEV-2, Significant Impact

Linear propagation · capacity · Affects 9 scenario(s)

Severity Classification

Classified as CRITICAL based on failure mode severity. This failure mode appears in 9 known architecture scenarios, indicating widespread relevance.

Propagation Chain

1

Origin component

Queue Backlog Accumulation begins at the source component. Trigger: Downstream database or API slowdown increasing per-message processing time.

Immediate (T+0) · Signal: Queue Depth

2

Downstream dependents

Failure propagates to directly dependent components via synchronous calls or shared resources. Latency increases and error rates rise on affected dependencies.

Seconds with consumer group lag monitoring and rate-of-change alerting. Without active lag monitoring: minutes to hours, depending on whether SLA violations on downstream systems are the first signal. By the time a user- facing SLA violation is observed, lag may have been growing for 30+ minutes. · Signal: Latency spike, connection timeout, or error rate increase on dependents

Blast Radius

Growing lag increases end-to-end latency for all data flowing through the queue: downstream systems receive events that happened minutes or hours ago. In event-driven architectures where downstream projections, notifications, or billing records are built from the queue, staleness propagates through all downstream systems. In the worst case (retention expiry), permanently lost messages produce silent data gaps in all downstream systems built from that queue.

Contributing Factors

Workload: Event Streaming Workloadoperational

Event streaming workloads produce events faster than consumers can process them during spikes, accumulating a consumer group lag that grows unboundedly if consumer throughput cannot recover to exceed producer throughput.

Trigger Condition: Downstream database or API slowdown increasing per-message poperational

This operational trigger enables Queue Backlog Accumulation: Downstream database or API slowdown increasing per-message processing time

Trigger Condition: Producer throughput spike (campaign, viral event, batch impooperational

This operational trigger enables Queue Backlog Accumulation: Producer throughput spike (campaign, viral event, batch import) exceeding sustained consumer capacity

Trigger Condition: Consumer instance failure or deployment restart reducing conoperational

This operational trigger enables Queue Backlog Accumulation: Consumer instance failure or deployment restart reducing consumer count

Mitigation Gaps

MEDIUMKnown mitigator 'backpressure' not in runbook

Add 'backpressure' to the runbook. Backpressure prevents queue backlog accumulation by signaling producers to slow or pause ingestion when the consumer is approaching capacity, ensuring the queue depth stays bounded rather than growing without limit.

Remediation Plan

ImmediateMeasure current lag and rate of change: is lag growing, stable, or shrinking?

Measure current lag and rate of change: is lag growing, stable, or shrinking?

Effort: Minutes to hours (on-call response)

ImmediateIdentify root cause: producer spike vs. consumer slowdown (compare produce rate

Identify root cause: producer spike vs. consumer slowdown (compare produce rate vs. consume rate)

Effort: Minutes to hours (on-call response)

ImmediateIf consumer slowdown: identify the slow stage via per-stage latency metrics and

If consumer slowdown: identify the slow stage via per-stage latency metrics and fix the bottleneck

Effort: Minutes to hours (on-call response)

Short-TermScale consumer instances to match producer throughput

Add consumer instances (up to the partition count for Kafka consumers). For Kafka, one consumer per partition is the maximum parallelism; if all partitions are consumed and lag still grows, partition count must increase or per-message processing time must decrease. For RabbitMQ, consumers can scale beyond queue count.

Effort: 1 day to 1 week

Short-TermIdentify and fix slow downstream dependencies

Instrument consumer processing time by stage. If the bottleneck is a database call, add a connection pool, fix a missing index, or batch the reads. If it is an external API, add a circuit breaker and process API-failure messages asynchronously with a dead-letter queue.

Effort: 1 day to 1 week

Short-TermConfigure Kafka retention to exceed maximum expected lag recovery time

If a consumer falls behind, it must be able to catch up before retention expires. Set retention.ms to at least 3× the expected maximum lag duration. For a consumer that may fall behind by 24 hours, set retention to 72+ hours.

Effort: 1 day to 1 week

Short-TermAdd alerting for documented detection signals

Configure alerts for: queue depth, alert, latency spike. Set thresholds to fire at 70% of critical level to allow response before full failure.

Effort: 1–3 days

Long-TermImplement producer rate limiting when consumer lag exceeds threshold

Monitor consumer lag and apply backpressure to producers when lag exceeds a safe threshold. Producers throttle their write rate or shed non-critical messages. This prevents lag from growing to retention expiry.

Effort: 1–4 sprints

Long-TermEliminate cross-scenario Queue Backlog Accumulation exposure

Queue Backlog Accumulation affects 9 architecture scenarios (Analytics Data Platform, Developer Tools Platform, Distributed Job Queue Platform). Design a shared mitigation strategy or a platform-level safeguard that prevents this failure mode from manifesting across all affected services.

Effort: 1–3 months

This post-mortem framework is derived from structured architecture knowledge. It provides an evidence-grounded starting point, not a substitute for a live incident review conducted by the team closest to the system. Adjust remediation priorities based on actual runtime observations.

Post-Mortem: Queue Backlog Accumulation: DBRaven