Stealing strategies from Nature!

Stealing strategies from Nature!
Photo by Pete Nuij / Unsplash

The most stable programming framework out there is Evolution. And one of its special modes is stress (gets activated when we perceive danger). Our body has a list of all running processes and their importance. During stress, our body will immediately route all power to the brain (to get clarity on the situation), activate our muscles (to get in motion if required). It kills all the secondary operations like food digestion (who need power if you don't survive), pain receptors.

2010 was a boon year for these butterflies in my garden. I had a dozen chrysalis in all manner of morphs at any one time. In this image you can see the new green chrysalis coloration, one that’s about ready to emerge (the clear one), and a butterfly that’s already come out. They will hang for hours and dry their wings and are, in fact, quite fragile.
Photo by Suzanne D. Williams / Unsplash

The same can be applied to solve scale problems in the software. When millions of people stream T20 on Hotstar, it is by definition under stress. Hotstar engineers took inspiration from evolution and designed the system in the same way. Kill all the processes that are secondary. Go into survival mode.

During the immediate spike, Hotstar stop all secondary processes like recommendation engine, personalized homepage, any secondary process that is a power hog.

They focus on a single primary feature i.e. streaming match without buffering.

Next time you face a problem, look for domains where it's already solved for inspiration before jumping to Stackoverflow :)