I was always wondering how does the login operation performs so quickly when I’m trying to login my Gmail or Facebook etc. What I mean is that, Google for example, has more thatn million servers, and it takes me nearly 2-3 second to login. I’m not doing anything with that large data now, but I may be later, so I’d like to reveal the technique now when I have time.
Please read the following so I know wherether my theory is right (at least part of it).
My thoughts where that servers are located all over the countries. Lets say 100 servers are in UK. When I’m trying to login, it just knows where I am and passes my username and password to those servers. The first server to find me in the database will respond.
This methods cuts off a large amount of data to be checked. But what when I move to USA for example, how it’ll know where to search first? …and how does servers deal with thousands of users logging at he same time?
Google replicates data almost to all datacentres across the globe. This is the main reason for Google’s speed. If you move to USA from UK, the data would not be already available at US. As soon as you login for the first time in US, the nearest server will be invoked which in turn finds the login history and replicates all the user data from the UK servers.
Note:Like yours, even mine is a theory not proved because Google never discloses these mechanisms