Loading
0x20Lesson 3 of 6

Choose a backend selection strategy

Compare round robin, least connections, weights, and hashing.

12 min 5-question quiz
By the end of this lesson you can
  • Select a routing algorithm based on backend capacity and workload behavior.

Round robin cycles through available backends and works well when instances and requests are similar. Weighted round robin sends a larger share to higher-capacity instances. Least connections can help when request durations vary, though connection counts are only a proxy for work. Hash-based routing can keep a key on the same backend, but can create skew and complicates membership changes.

A policy is only as good as its inputs. Long-lived connections, uneven request cost, and stale health or load measurements can make a seemingly fair algorithm distribute actual work poorly.

Practice: pick the algorithm that survives

Try it

Up to 15 XP

Find what works for each traffic pattern

Each scenario has a different answer. The bar shows the busiest moment for each backend, and the line marks what it can handle.

Try every algorithm, and work out why the others fail before moving on.

app-c has four times the capacity of the other two, and every request costs the same.

Routing algorithm
  • app-abusiest: 4 of 3, handled 80
  • app-bbusiest: 4 of 3, handled 80
  • app-cbusiest: 4 of 12, handled 80

The bar is the busiest moment. The line marks what the backend can handle.

Overloaded: app-a, app-b.

0 of 3 scenarios solved

Key takeaways

  • Use round robin for fairly uniform pools and workloads.

  • Weights represent known capacity differences.

  • No selection algorithm can compensate for misleading signals or severe key skew.

Lesson quiz

5 questions · pass with 4 correct · up to 50 XP

Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.

Questions about this lesson

Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.

Loading posts…