13.07.2015 Views

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

Software Engineering for Internet Applications - Student Community

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Balancer and mod_backhand, a load balancer module <strong>for</strong> the ApacheWeb server. An alternative is exemplified by F5 Networks, acompany that sells out-of-the-box load balancers built on PChardware, the NetBSD Unix operating system, and unspecified magicsoftware.11.3.3 FailoverRemember our strategic goals: (1) user requests are divided more orless evenly among the available CPUs; (2) when a piece of hardwarefails it doesn't result in too many errors returned to users; (3) we canreconfigure hardware and network without breaking users'bookmarks and links from other sites.It seems as though the load balancing router out front and loadbalancing operating system on the RDBMS server in back haveallowed us to achieve Goals 1 and 3. And the hardware failure occursin a front-end single-CPU machine, we've achieved Goal 2 as well.But what if the multi-CPU RDBMS server fails? Or what if the loadbalancer itself fails?Failover from a broken load balancer to a working one is essentially anetwork configuration challenge, beyond the scope of this textbook.Basically what is required are two identical load balancers andcooperation with the next routing link in the chain that connects yourserver farm to the public <strong>Internet</strong>. Those upstream routers must knowhow to route requests <strong>for</strong> the same IP address to one or the otherload balancer depending upon which is up and running. What keepsthis from becoming an endless spiral of load balancing is that theupstream routers aren't actually looking into the TCP packets to findthe GET request. They're doing the much simpler job of IP routing.Ensuring failover from a broken RDBMS server is a more difficultchallenge and one where a large variety of ideas has been tried andfound wanting. The first idea is to make sure that the RDBMS servernever fails. The machine will have three power supplies, only two ofwhich are required. Each disk drive will be mirrored. If a CPU boardfails the operating system will gracefully fail back to running on theremaining CPUs. There will be several network cards. There will betwo paths to each disk drive. Considering the number of moving partsinside, the big complex servers are remarkably reliable, but theyaren't 100 percent reliable.Given that a single big server isn't reliable enough, we can buy awhole bunch of them and plug them all into the same disk214• adserver <strong>for</strong> selling, placing, and logging banneradvertisements• calendar (personal, group, and site-wide events)• classified ads and auctions• ecommerce (catalog of products, table of orders,presentation of product pages with reviews from communitymembers, billing and accounting)• email, server-based email (like Hotmail) <strong>for</strong> communitymembers• survey (opinion polls and other types of surveys among themembers)• weblog, private blogs <strong>for</strong> each community member whowants one, possibly sharing tables with articles but differentediting, approval workflow, and presentation interfaces plusRSS feeds, trackback, and the rest of the machine-tomachineinterfaces that are expected in the blog world• (trouble) ticket tracker <strong>for</strong> bug and feature request trackingGood software developers might disagree on the division intomodules. For example, rather than create a separate classified adsmodule, a person might decide that classifieds and discussion are sosimilar that adding price and bid columns to an existing content tablemakes more sense than constructing new tables and that adding a lotof IF statements to the scripts that present discussion questions andanswers makes more sense than writing new scripts.If the online community is used to support a group of universitystudents and teachers additional specialized modules would beadded, e.g., <strong>for</strong> recording which courses are being taught by whomand when, which students are registered in which courses, whathandouts are associated with each class, what assignments are dueand by when, and what grades have been assigned and by whichteachers.Recall that the software behind an <strong>Internet</strong> service is frequentlyupdated as the community grows and new ideas are developed.Frequently updated software is going to have bugs, which means thatthe system will be frequently debugged, oftentimes at 2:00 am andusually by a programmer other than the one who wrote the software.It is thus important to publish and abide by conventions that make iteasy <strong>for</strong> a new programmer to figure out where the relevant sourcecode files are. It might take only 15 minutes to figure out what iswrong and patch the system. But if it takes 3 hours to find the source135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!