Across the web, sites experience a wide range of network traffic requirements. Sites such as Google, Yahoo, Amazon, and Microsoft obviously experience tens of millions of user hits per day. To handle such web requests, the sites use a technique known as load balancing, as shown in FIGURE 4-5, to share the requests across multiple servers.
For a simple webpage, a client’s web browser requests an HTML page and then the related graphics, CSS, and JavaScript files from the web server, as shown in FIGURE 4-6.
When demand becomes too great for the server, the company can place a load-balancing server in front of two or more servers to which the load balancer distributes the web requests. Load balancing for simple applications is quite straightforward, as either server can handle all requests.
When server-based applications become more complex, accessing data within a database, for example, the developers must provide shared access to the database. To eliminate a single point of failure, companies will often replicate copies of the database on multiple servers. The database software, in turn, must then synchronize data updates across the systems, as shown in FIGURE 4-7.
As an alternative, the company may choose to simplify the solution using a cloud-based database or a cloud-based network attached storage device, as shown in FIGURE 4-8. In this way, the applications do not need to worry about the data synchronization and replication—that task is handled within the cloud.
To better understand load balancing, consider the processing that occurs when a user visits a site such as Yahoo. To start, the user types in a domain name, such as www.yahoo.com. The user’s web browser, in turn, sends the domain name to a special server on the web called a domain-name server (DNS), which, in turn, returns the site’s (Yahoo’s) Internet protocol (IP) address. As shown in FIGURE 4-9, the browser then uses the IP address to contact the server.
When a site uses load balancing, the IP address returned by the DNS might correspond to the load-balancing server. When the load balancer receives the browser request, it simply sends the request to one of the servers on a round-robin basis. Should demand on the site increase, additional servers can be added, to which the load balancer can distribute requests. Using a similar technique, most IaaS solutions provide on-demand scaling and load balancing.