📄 lib0058.html
字号:
<html>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Scalability and High Availability</title>
<link rel="STYLESHEET" type="text/css" href="images/xpolecat.css">
<link rel="STYLESHEET" type="text/css" href="images/ie.content.css">
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/teamlib.gif" width="62" height="15" border="0" align="absmiddle" alt="Team LiB"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href="LiB0057.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0059.html"><img src="images/next.gif" width="41" height="15" border="0" align="absmiddle" alt="Next Section"></a>
</div></td></tr></table>
<br>
<div class="chapter">
<a name="ch08"></a>
<div class="section">
<h2 class="first-section-title"><a name="267"></a><a name="ch08lev1sec4"></a>Scalability and High Availability</h2><p class="first-para">Scalability and high availability come from the network architecture's provision of redundant Web servers, application servers, and database servers. <a name="268"></a><a name="IDX-106"></a>Additionally, some architectures might have LDAP and messaging server redundancies.</p>
<p class="para">Hardware redundancies provide scalability by distributing the load over multiple machines. For instance, if your application servers can handle 1,000 concurrent users each, you need five to handle 5,000 users. You can keep adding to your heart's content. The same concept holds for all the other types of servers.</p>
<p class="para">Hardware redundancies provide high availability by reducing the chances that all hardware will be down at the same time and all users prevented from using your site. The more redundancy, the lower the probability of outage (theoretically, at least). Using this logic, diminishing returns appear very quickly. After three servers, the probability of an outage is so low that the probability reductions associated with additional servers are minuscule.</p>
<p class="para">One important corollary to the hardware redundancy principle is that your site is only as strong as your weakest link. One of my clients provides effective redundancies at all levels, except that the company's database doesn't support using multiple servers without manual intervention and some amount of data loss. For this client, adding more servers would achieve little to nothing toward high availability because the company has an unguarded single point of failure anyway. This client's scalability is also limited because the company can only scale the size of the single database server and doesn't have opportunities to increase bandwidth.</p>
<p class="para">The amount of redundancy of each piece of hardware doesn't necessarily increase in parallel. For example, you might add more application servers while leaving the number of Web servers alone. You might increase the number of load balancers and leave the number of Web servers and application servers alone. The roles additional servers play depends on where your CPU cycles are being spent.</p>
<p class="para">System administrators have different ways to bind an army of servers together. One method is to use some type of load-balancing software or appliance. The cheapest tool is a DNS that distributes the load in a round-robin manner. For a large site, however, the company usually purchases a load-balancing appliance that uses a distribution algorithm that is more sophisticated and more efficient than round-robin.</p>
<p class="para">Some operating systems have clustering capabilities, which bind together multiple machines to look like one machine. Because the machines communicate on a low level, if one machine crashes, fail-over is generally quick and the probability of transaction failure during the crash is low.</p>
<a name="269"></a><a name="IDX-107"></a>
<p class="para">Operating system clustering is usually complemented by application server software and database software. For example, BEA's WebLogic<span class="unicode">™</span> product supports clustering. Oracle's database software also supports clustering (this feature is called Parallel Server).</p>
<p class="para">Generally, clustering technologies are costly on a number of fronts. Outright licensing fees are often high for clustered solutions. But far more significant are the support costs associated with effectively administering and configuring such an environment, which you cannot avoid if you want to get the maximum benefit from the software purchase.</p>
<div class="section">
<h3 class="sect3-title">
<a name="270"></a><a name="ch08lev2sec2"></a>Architecting Scalability and Availability</h3>
<p class="first-para">
<b class="bold">Audit all objects placed on the session to ensure that they are serializable. </b>J2EE applications usually place information on the session, and J2EE containers must be able to serialize these objects and transport them to other servers to use in the event of a failure. If these objects contain anything that doesn't implement <span class="fixed">java.io.Serializable</span>, the container will not be able to provide a seamless transition to another server in response to a failure.</p>
<p class="last-para">
<b class="bold">Keep all code servers generic.</b> The clustering capabilities that J2EE containers provide depend on the fact that code executed on one node in the cluster operates the same way when executed in another node. I've seen applications inadvertently make code environment aware and not be able to function in a clustered environment.</p>
</div>
</div>
</div><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td><div STYLE="MARGIN-LEFT: 0.15in;"><a href="toc.html"><img src="images/teamlib.gif" width="62" height="15" border="0" align="absmiddle" alt="Team LiB"></a></div></td>
<td align="right"><div STYLE="MARGIN-LEFT: 0.15in;">
<a href="LiB0057.html"><img src="images/previous.gif" width="62" height="15" border="0" align="absmiddle" alt="Previous Section"></a>
<a href="LiB0059.html"><img src="images/next.gif" width="41" height="15" border="0" align="absmiddle" alt="Next Section"></a>
</div></td></tr></table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -