skip to content

A reader group's gap is flat, rising steadily, or sawtoothing over a one-hour observation window — what does each shape mean?

level: middleimportance: must knowfreq 58%

answer

  1. read the slope, not the height
  2. a level with two taps
  3. flat means rates are equal
  4. slope equals the rate difference
  5. sawtooth means one side is bursty

basics

~20 s

Flat means arrival and drain rates match, at whatever height. A steady rise means the drain rate is below the arrival rate, and the slope is the difference. A sawtooth means arrival or reading happens in bursts rather than continuously.

solid answer

~50 s

The instantaneous value of a reader group's gap is worth less than its shape over an observation window, because the shape is the derivative and the derivative is the diagnosis. A **flat non-zero** curve means records are being read exactly as fast as they arrive; the height is just a standing buffer and is not by itself a fault. A **straight rise** means the reading side drains slower than the writing side fills, and the slope is literally the difference between the two rates. A **sawtooth** — climbing, then dropping sharply, repeatedly — means one of the two sides is bursty: records arrive in batches, or a reader runs on a schedule and clears everything each time it wakes. Two further shapes are worth naming: a **falling** curve is recovery in progress, and a curve that rises then abruptly flattens at a constant height often means the oldest unread records are being removed as fast as new ones accumulate.

go deeper

for a junior

Know that the direction matters more than the number: flat means keeping up, rising means falling behind, falling means catching up. Being able to say that a steady non-zero gap is normal is already a good answer.

for a middle

Explain the level-with-two-taps model and derive each shape from it, including why the slope of a rise equals the difference between arrival and drain rates and why a sawtooth points at burstiness on one side.

for a senior

Show that you check the age reading beside the count so you can tell a genuine stabilisation from a curve pinned against the retention ceiling, and that you compare against the arrival rate before blaming the reading side.

for a principal

Talk about making the shape the shared language across teams — what a curve must be published over, and why an aggregate-only view for a shared stream produces incidents that nobody can read correctly at speed.

## Why the shape beats the value A gap of four hundred thousand records means almost nothing on its own. The same figure is a healthy system that has always sat there and a failing system that passed through it twenty minutes ago on the way up. What separates those two is the **first derivative** — whether the number is going up, down or nowhere over an observation window. The underlying model is a level with two taps. The arrival rate fills it, the drain rate empties it, and the gap is the level. Everything below follows from that. ## Flat and non-zero The level is constant, so the two rates are equal. That is a steady state, not a fault. A standing gap has ordinary causes: - Readers fetch in batches, so a batch's worth is permanently in flight. - There is a fixed pipeline delay between a record arriving and the position moving past it. - The reading side was deliberately provisioned to keep up, not to be ahead — being exactly at the newest record is not a goal anyone should pay for. What matters is that it is flat *at a height you have seen before*. A flat curve at ten times its usual height is a level that rose earlier and then stabilised, which is a different story from a level that never moved. ## Rising in a straight line A constant slope means a constant deficit: the drain rate is lower than the arrival rate by exactly the slope. Whether that is the readers slowing down or the writers speeding up is not visible in this curve alone — you need the arrival rate on the same window to tell them apart, and that distinction matters because the two have different owners. A straight rise also has a property worth saying out loud: it does not self-correct. A level with a constant deficit grows without bound until something changes, and on platforms that remove old records after a fixed period, what eventually changes is that the oldest unread records are deleted before anyone reads them. ## Rising with a curve Two curved rises show up and mean opposite things: 1. **Accelerating** (getting steeper) — the deficit itself is growing. This is often a feedback effect: the reading side is degrading as it goes, or the arrival rate is still climbing toward a peak. 2. **Decelerating** (flattening out) — the deficit is shrinking; the system is heading toward a new, higher steady state rather than toward infinity. An accelerating curve is the one to take seriously fastest, because extrapolating a straight line understates where it is going. ## Sawtooth A regular climb followed by a sharp drop, repeating on a period, means one side is bursty. Both causes are common and they are distinguishable: | What you see | Likely cause | How to tell | |---|---|---| | Climb is fast, drop is near-vertical, period is regular | The reading side runs on a schedule and clears the accumulation each time it wakes | The period matches a schedule, and the drop is faster than any plausible arrival pause | | Climb is near-vertical, then a steady decline | Records arrive in batches; the reading side drains continuously between arrivals | The step up matches a known upstream batch job's size | A sawtooth is not by itself a fault. The two readings to take from it are the **peak** (does the height at the top of each tooth stay constant, or creep up tooth by tooth?) and the **age at the peak** (how stale is the oldest record at the worst moment of each cycle?). A sawtooth whose peaks creep upward is a rising curve in disguise — the drain is not quite clearing each batch. ## Falling, and flattening at a ceiling A falling curve is recovery, and its slope says how fast. The useful arithmetic is comparing that slope against the arrival rate, because a curve that falls only while arrivals are low is not really recovering — it is waiting for the night. The shape that misleads most often is a rise that stops abruptly and becomes flat at a large value. It reads like the problem stabilising. On platforms that delete records after a retention period, it can instead be the ceiling: records are ageing out at the oldest end exactly as fast as they arrive at the newest, so the count cannot grow any further. The tell is the age reading alongside it — an age pinned at a constant value close to the retention span, rather than still climbing, means records are being lost rather than accumulating. ## Per-unit against aggregate One caution that applies to every shape above: where a stream is divided into parts and each part carries its own gap, the curve you are looking at is usually a sum. A sum can be flat while its terms are not, so a shape read off the aggregate is a first reading and not a final one.

  • A gap that had been rising steadily goes flat at a large value. Why is that not necessarily good news?
    Two very different things produce it. Either the drain rate has risen to meet the arrival rate, and the level has simply stabilised high, or the oldest unread records are being removed as fast as new ones arrive and the count physically cannot grow. Read the age alongside it: still climbing means the first, pinned near the retention span means the second.
  • How do you tell a rising gap caused by slower readers from one caused by heavier writers?
    The gap curve alone cannot: both produce the same slope. Put the arrival rate on the same observation window. A flat arrival rate with a rising gap is a reading-side problem; an arrival rate that stepped up at the same moment the slope appeared is a writing-side one. They are different teams' problems, which is why the distinction is worth the second chart.
  • Why does the choice of observation window change what shape you see?
    A window shorter than a burst period shows only one tooth, which looks like a rise or a fall. A window much longer than the period averages the teeth into a flat line and hides the peaks entirely. The window has to be a few multiples of whatever period the workload actually has, which means knowing the workload's rhythm before reading its curve.

saying these in an interview costs you the question

  • Calls any non-zero gap a problem regardless of shape
  • Reads the current value and never the trend
  • Assumes a flattening curve always means recovery
  • Extrapolates an accelerating curve as if it were straight
  • Treats a regular sawtooth as instability
  • Reads an aggregate shape as if every part shared it