educative.io

Why is random load balancing better than sequential?

What problem might arise if shards are selected in an order (sequentially) rather than randomly?

Answers include:
A) The write request queue increases
B) Maximum shard utilization decreases
D) The user will not get quick responses

What’s the reason behind these issues?


Course: Grokking Modern System Design Interview for Engineers & Managers - AI-Powered Learning for Developers
Lesson: https://www.educative.io/courses/grokking-modern-system-design-interview-for-engineers-managers/quiz-on-the-sharded-counters-design

Hi Isaac,

The reasons behind these issues are as follows:

A) The write request queue increases: Sequential shard selection leads to uneven distribution, causing some shards to receive more write requests, increasing their queues.

B) Maximum shard utilization decreases: Some shards become overloaded with sequential selection while others are underutilized, reducing overall efficiency.

D) The user will not get quick responses: Sequential selection can result in longer response times, especially if requests are directed to overloaded shards, impacting user experience.

We hope this provides a clear understanding of the reasons behind the issues. Happy learning at Educative!

Thank you,

Hey @Yasir_Latif!

Sequential shard selection leads to uneven distribution, causing some shards to receive more write requests, increasing their queues.

It seems like sequential selection would lead to more even distribution than random selection, especially with lower request loads or unlucky RNG. Why does sequential yield uneven distribution?