Let's start with fun facts today shall we? Google has the highest number of monthly visits in the world with 92.5 Billion visits, YouTube comes second with 34.6 Billion, Facebook is third with 25.5 Billion visits and Twitter is fourth with 6.6 Billion. These are mind-blowing numbers. The average website will crash long before hitting these numbers as such we have to ask how some organizations are able to entertain this many visitors on a monthly basis without bringing the house down. There are some ways in which companies are able to become scalable across the world, some of these methods include having more servers, revamping the algorithm of their software solutions to perform faster, leveraging stored procedures on the database among other tactics.
LOAD BALANCING EXPLAINED
Today I'm going to dwell on something else and it's called "Load balancing". When you log into a platform, you as a visitor on the platform are causing a bit of a strain on the server as the server has to entertain you by serving you pages and resources you need. Bear in mind that it's also serving others, just like a restaurant, there are the easy customers and there are the customers who want bespoke treatment, both the easygoing customer and the others are stressing out the waiter (albeit to different degrees) and this adds up.
HOW DOES IT HAPPEN?
Load balancing distributes the traffic between servers using several ideologies , the two most popular are; round-robin and least connection, with round-robin, the traffic is distributed in sequence depending on the number of servers. If there are four servers, visitor 1 gets directed to server 1, visitor 2 gets server 2, visitor 3 gets server 3, visitor 4 gets server 4, visitor 5 gets server 1 and it keeps going like that. Least connection involves directing the visitor to the server that is attending to the least amount of users.
A RELATABLE EXPLANATION
Load balancing is akin to a restaurant splitting the responsibility of taking orders (from customers) between several waiters in such a way that no single waiter is over laboured to the point of collapsing due to exhaustion. With load balancing, you and the person sitting next to you can access the same platform at the same time and be attended to by different servers, because of this, there is more efficiency on the platform, less downtime, more (engineering) redundancy), and a platform can thus be referred to as scalable.
FINALLY...
Do note that this isn't a foolproof solution as the burden on a server isn't just as a result of the number of people being attended to but their requests, a server can have 200 people and fail where the same server can accommodate 2000 people. The question is "What are these people doing?". Typically, people on an e-commerce store who run searches a lot and filter based on parameters stress out the server much more than people who select an item from the homepage, pay and leave. All in all, today we've learnt a little bit about how we get a digital infrastructure to scale across the globe. See you tomorrow ๐.