BeginnerCoder

Lesson 21 — Round-robin revisited

Skip servers that are down

Plain round-robin keeps sending requests to a server even after it crashes. A smarter balancer skips servers that failed their health check. Filter the healthy ones first, then rotate through only those.

const open = shops.filter((s) => s.isOpen);

Note: real DevOps tools (CI servers, load balancers, Docker, Kubernetes) cannot run in your browser, so this exercise is a small plain-JS simulation of the logic those tools use.

Why it matters: users never get routed to a dead machine.

Want it another way?
Task

Rotate only through healthy servers: build up with filter, then pick up[i % up.length].

Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.

← Back
Next →
Test your knowledge

A quick 3-question quiz on this lesson — instant feedback.

Enjoying this lesson? Share it.

Keep going with DevOps Foundations

Ready for more? Optional paid resources that pick up where this lesson leaves off.

Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.