TOPIC 06/089 MINNOT STARTED

Batching and horizontal scaling

Batching and horizontal scaling both promise more throughput. Each has a precondition that, unmet, turns the promise into a new failure mode.

L1–L4 are part of the Pro pass

L0 Explain simply

A gate that checks one visitor at a time, however fast, has a scaling ceiling. Two ways past that ceiling are obvious, and both have a catch a beginner would not expect.

The first is to stop checking one visitor at a time and check a whole group at once — one pass over many people instead of one pass per person. That is batching. The catch: an early arrival may wait for a group, but a size target or timer can end that wait; a full group need not wait for the timer too.

The second is to open more gates. That is . The catch: the design must route each visitor to the right paperwork, either through interchangeable gates with shared records or through gates responsible for particular groups. If one gate is the only one holding a particular visitor's paperwork from an earlier stop, sending that visitor to a different gate does not speed anything up — it breaks the check entirely.

Both techniques are standard, both are borrowed from general computing rather than invented for screening, and both are explored in the rungs ahead with the catch made precise rather than left as an intuition.

PLAIN WORDS · 2 in this section
interchangeable
one can be swapped for another
rungs
steps of a ladder, or levels in rank

PICTURE IT

A shuttle van that waits to fill, and extra ticket desks

Picture a small shuttle van that carries visitors from a car park to a hall. A trip costs the same fuel and driver time whether the van holds one visitor or a full load. So the driver waits until the van is full or a timer runs out, then goes. Each trip is cheaper per visitor, but the first visitor who sat down waits the longest. Now the hall adds more ticket desks for a bigger crowd. This helps when paperwork access and routing are correct; desks can share records or own particular groups. Suppose one desk keeps a private notebook of who has a ticket. A visitor sent to another desk may get a second ticket, and nobody notices. The picture is imagined; real systems differ.

THE REAL JOB Batching and extra copies of a service let screening handle more payments, as long as each technique's precondition holds.

  1. Checking one record at a time hits a ceiling
  2. Batching groups records into one matching pass
  3. A batch waits to fill or for a timer
  4. Horizontal scaling adds more instances
  5. Verify correct access, ownership and routing for related requests
  6. Use a tested shared-state or stateful-partition design
Two techniques, each with its precondition

HOW THE PICTURE MAPS

How each part of the picture matches the payment
In the pictureIn the payment
The van leaving when full or when the timer runs outA batch sent at its target size or its maximum wait
One trip's fuel and driver time shared by everyone aboardFixed costs of each call, paid once for the whole batch
The first visitor who sat down and waits longestThe first record in a batch, which waits the longest
More ticket desks beside the firstMore instances of the same matching service, which is horizontal scaling
The visitor sent to whichever desk is freeA load balancer spreading requests across instances
A private notebook at one deskInformation held in one copy of the service's memory, such as a deduplication window
A shared register every desk can readA shared store, which is what statelessness relies on

WHERE THIS PICTURE STOPS

  • A visitor in the van can see the delay and can walk instead. A record in a batch cannot see it, and its payment rail may give it a deadline.
  • A desk with a private notebook gives a visitor an odd look. In a service, a missing note raises no error and no alert, and the health checks still pass. The picture makes the failure look easier to spot than it is.
  • The van and the desks are one picture of two separate techniques. A real pipeline can use both at once, and the topic says they are general software techniques, not something built only for screening.
  • A full Kafka batch sends before linger expires. A traffic spike can fill it sooner; downstream queueing is a separate delay. Stateful designs can scale with appropriate ownership and routing.

HOOK

Batching: when does it send? Scaling: who owns the state?

REMEMBER IT THIS WAY

A contrast: two neighbours told apart by one test.

Batching: who waits? Scaling: who remembers?

What each part of the trick stands for
In the trickWhat it stands for
who waitsthe first record in a batch waits for the batch to fill or a timer to run out
who remembersrelated requests must reach consistent state, through shared access or correctly owned and routed stateful partitions

A pipeline can use both techniques, so ask both questions, and neither question locates a delay, which needs a stage-by-stage budget.

TELL A FRIEND

Batching saves effort by checking records together, but every record waits for its batch. Adding copies requires correct state access and routing, through stateless workers or stateful partitions.

OFTEN MIXED UP WITH Throughput, latency and capacity. Throughput and capacity ask how much spare room a system has and how slow its slowest payments get. This topic asks what each way of adding room needs first, and how each one fails quietly when that is missing.

PRACTISE AND KEEP

Sources for this topic — 5 sources
  1. Market practice

    Kubernetes documentation — Horizontal Pod Autoscaling ↗ — The Kubernetes Authors (Cloud Native Computing Foundation) · Horizontal scaling of stateless workloads

    The standard, vendor-neutral description of horizontal scaling: adding more instances of a stateless service to absorb more load. A controller coordinates the decision, watching an observed metric (commonly CPU or a custom load signal) against a target and adjusting the replica count automatically. Cited for the mechanism and its precondition — the workload has to be stateless, or safely externalise its state, before adding a replica helps rather than corrupts anything.

    Cited on this site for the general pattern a screening estate's engine tier would apply, not for Kubernetes as a required or even likely runtime. No screening product's actual deployment architecture is asserted from this source. · Checked 2026-09-08

    Search excerpts only, page not opened, so this was read as search summarisation over the official documentation's own wording.

    Kubernetes is a Cloud Native Computing Foundation (CNCF) graduated open-source project with open governance, not a single vendor's product — chosen over a specific cloud provider's load-balancing documentation for that reason.

  2. Market practice

    Site Reliability Engineering: How Google Runs Production Systems — "Monitoring Distributed Systems" ↗ — Google (Betsy Beyer, Chris Jones, Jennifer Petoff, Niall Richard Murphy, eds.) · Percentile monitoring and latency attribution

    Google's chapter on monitoring a service people use. Cited for two things: the argument for measuring in percentiles rather than an average, because an average can look healthy while a real fraction of requests breach a deadline. Also cited for the four golden signals (latency, traffic, errors and saturation), the counting of policy-based errors such as an answer slower than a promised time, and the advice to alert on symptoms more than causes. Cited for these practices generally, not as evidence about how any payments platform is built. · Checked 2026-11-08

    Freely published in full by Google at sre.google — not a paywalled or excerpted source. Verification boundary: sre.google answers a network egress block through this environment's proxy, so the chapter's argument was confirmed via search summarisation of its publicly indexed content rather than a direct fetch of the page. 2026-10-11: confirmed by search excerpts from sre.google (page not opened): the four golden signals. Timing failed requests separately. Explicit, implicit and policy-based errors. Saturation and the 99th-percentile early signal. 'spend much more effort on symptoms than causes' and 'only worry about very definite, very imminent causes'.

    6 November 2026: opened primary chapter, especially The Four Golden Signals and Worrying About Your Tail. Inspected latency of successful versus failed requests, errors, traffic, saturation and percentile monitoring. This does not establish a deployed payment-system SLA.

    8 November 2026: primary Chapter 6 Definitions, Why Monitor, Symptoms Versus Causes, Black-Box Versus White-Box, Four Golden Signals and tail discussion opened; selected coverage, actionable alerts and separate success/error latency. Historical practice, not a universal detection guarantee.

  3. Simplified educational illustration

    Payments Signal editorial teaching models — Payments Signal

    This site's own simplified teaching models. · Checked 2026-07-12

    What this simplifies: Synthetic training examples and engineering illustrations are not deployed-bank benchmarks, universal legal permissions or mandatory vendor architectures.

    Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.

  4. Implementation-specificKafka 4.0

    Apache Kafka — Producer Configs ↗ — Apache Software Foundation · Kafka 4.0 producer configs, batch.size (bytes per partition), linger.ms and delivery.timeout.ms; opened 6 November 2026. Full batch or linger ends intentional waiting; backpressure and acknowledgement are separate.

    Implementation-specific producer batching example. A full per-partition batch sends before linger expires; the timer bounds intentional waiting, not all backpressure or delivery delay. Larger limits may improve efficiency but do not guarantee throughput or worsen total latency. · Checked 2026-11-06

    Opened primary Apache Kafka 4.0 documentation on 6 November 2026: batch.size, linger.ms and delivery.timeout.ms. Not a universal screening architecture or a bank benchmark.

  5. Implementation-specific

    Kubernetes — StatefulSets ↗ — Kubernetes Authors · StatefulSets overview/Using StatefulSets and replicas, page modified 12 October 2026, opened 6 November 2026: stable identity and stateful scaling; application state ownership remains a separate design obligation

    Implementation-specific example of deploying and scaling stateful workloads with stable identities and storage; disproves the claim that horizontal scaling requires statelessness. · Checked 2026-11-06

    Opened current primary project documentation on 6 November 2026, StatefulSets and Using StatefulSets. Not a deployed-bank architecture, legal requirement or guarantee of correct application state handling.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.