Comparison
BackpressurevsConsumer lag
Backpressure
the consumer tells the producer to slow down rather than silently buffering work it cannot keep up with.
A mechanism by which a saturated component signals upstream to reduce its rate. The alternative is an unbounded buffer, which converts a throughput problem into a memory exhaustion problem and hides it until the process dies. Bounded queues that block or reject are the simplest form; explicit credit-based flow control is the sophisticated one.
Full entry →Consumer lag
the producers are writing faster than the consumers are reading and the backlog has been growing all afternoon.
How far behind the head of the stream a consumer group is, or how many messages are waiting in a queue. It is the single best health metric for an async system, because it captures capacity, failure and slowdown in one number. Alert on the trend rather than the absolute value: a constant lag is a working system, a rising one is an outage in about an hour.
Full entry →