round robin
A way of spreading work by taking turns in a fixed order, giving the next item to the next recipient in the list.
In more detail
Round robin spreads load evenly without needing to know anything about the items. It gives no ordering across recipients.
Examples
Some Kafka partitioners send unkeyed records to partitions in turn.It spreads requests evenly by count, not by how busy each backend is. Long-lived connections or slow requests can therefore leave some backends busier than others.The Node.js cluster primary uses round robin (cluster.SCHED_RR) by default on every platform except Windows.Related terms
- partitioner — The producer component that chooses which partition each record is sent to.
- sticky partitioning — A strategy for unkeyed records that keeps sending to one partition until the current batch is full, then moves on to another.
- partition assignment — The decision about which consumer in a group reads which partitions.
- load balancing — Spreading requests or connections across several backend servers so no single one is overloaded and failed ones can be avoided.
- least connections — A load-balancing algorithm that sends each new request to the backend currently handling the fewest active connections.
- backend pool — The set of servers a load balancer can send traffic to, each marked eligible or not by health checks.
- cluster module — The Node.js module that starts several copies of a server as worker processes sharing one port, so a machine's CPU cores can all serve requests.
- power of two random choices — A load balancing method that picks two backends at random and sends the request to the less busy one.
Taught in
- Twenty Seconds Of Nothing — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Topics, Partitions And Where A Record Lands — Apache Kafka & Event Streaming
- Keys And Ordering Per Partition — Apache Kafka & Event Streaming
- Load Balancing: Algorithms, Health Checks And Layers — Linux Fundamentals & Systems Administration
- Cluster Architecture: node:cluster & Zero-Downtime — Node.js Internals & Backend Services
- Load Balancing And The Failure Modes It Introduces — Scalable System Design & Distributed Architecture
References
- Apache Kafka producer configs: partitioner.class
- NGINX: using nginx as HTTP load balancer
- HAProxy documentation
- Node.js: Cluster (How it works)
- Envoy documentation: Supported load balancers