Docsity

Improving Availability in Large-Scale Apps: Harvest, Yield & Scalable Tolerant Systems, Essays (high school) of Computer science

Toggle sidebar
bg1
Harvest, Yield, and Scalable Tolerant Systems
Armando Fox
Stanford University
Eric A. Brewer
University of California at Berkeley
Abstract
The cost of reconciling consistency and state manage-
ment with high availability is highly magnified by the un-
precedented scale and robustness requirements of today’s
Internet applications. We propose two strategies for im-
proving overall availability using simple mechanisms that
scale over large applications whose output behavior toler-
ates graceful degradation. We characterize this degradation
in terms of harvest and yield, and map it directly onto engi-
neering mechanisms that enhance availability by improving
fault isolation, and in some cases also simplify program-
ming. By collecting examples of related techniques in the
literature and illustrating the surprising range of applica-
tions that can benefit from these approaches, we hope to
motivate a broader research program in this area.
1. Motivation, Hypothesis, Relevance
Increasingly, infrastructure services comprise not only
routing, but also application-level resources such as search
engines [15], adaptation proxies [8], and Web caches [20].
These applications must confront the same
24
7
opera-
tional expectations and exponentially-growinguser loads as
the routing infrastructure, and consequently are absorbing
comparable amounts of hardware and software. The current
trend of harnessing commodity-PC clusters for scalability
and availability [9] is reflected in the largest web server in-
stallations. These sites use tens to hundreds of PC’s to de-
liver 100M or more read-mostly page views per day, pri-
marily using simple replication or relatively small data sets
to increase throughput.
The scale of these applications is bringing the well-
known tradeoff between consistency and availability [4]
into very sharp relief. In this paper we propose two gen-
eral directions for future work in building large-scale ro-
bust systems. Our approaches tolerate partial failures by
emphasizing simple composition mechanisms that promote
fault containment, and by translating possible partial failure
modes into engineering mechanisms that provide smoothly-
degrading functionality rather than lack of availability of the
service as a whole. The approaches were developedin the
context of cluster computing, where it is well accepted[22]
that one of the major challenges is the nontrivial software
engineering required to automate partial-failure handling in
order to keep system management tractable.
2. Related Workand the CAP Principle
In this discussion, strong consistency means single-
copy ACID [13] consistency; by assumption a strongly-
consistent system provides the ability to perform updates,
otherwise discussing consistency is irrelevant. High avail-
ability is assumed to be provided through redundancy, e.g.
data replication; data is considered highly available if a
given consumer of the data can always reach some replica.
Partition-resilience means that the system as whole can sur-
vive a partition between data replicas.
Strong CAP Principle. Strong Consistency, High
Availability, Partition-resilience: Pick at most 2.
The CAP formulation makes explicit the trade-offs in
designing distributed infrastructure applications. It is easy
to identify examples of each pairing of CAP, outlining the
proof by exhaustiveexample of the Strong CAP Principle:
CA without P: Databases that provide distributed
transactional semantics can only do so in the absence
of a network partition separating server peers.
CP without A: In the event of a partition, further trans-
actions to an ACID database may be blocked until the
partition heals, to avoid the risk of introducing merge
conflicts (and thus inconsistency).
AP without C: HTTP Web caching provides client-
server partition resilience by replicating documents,
but a client-server partition prevents verification of the
freshness of an expired replica. In general, any dis-
tributed database problem can be solved with either
expiration-based caching to get AP, or replicas and ma-
jority voting to get PC (the minority is unavailable).
pf3
pf4
pf5

Partial preview of the text

Download Improving Availability in Large-Scale Apps: Harvest, Yield & Scalable Tolerant Systems and more Essays (high school) Computer science in PDF only on Docsity!

Harvest, Yield, and Scalable Tolerant Systems

Armando Fox

Stanford University

[email protected]

Eric A. Brewer

University of California at Berkeley

[email protected]

Abstract

The cost of reconciling consistency and state manage- ment with high availability is highly magnified by the un- precedented scale and robustness requirements of today’s Internet applications. We propose two strategies for im- proving overall availability using simple mechanisms that scale over large applications whose output behavior toler- ates graceful degradation. We characterize this degradation in terms of harvest and yield , and map it directly onto engi- neering mechanisms that enhance availability by improving fault isolation, and in some cases also simplify program- ming. By collecting examples of related techniques in the literature and illustrating the surprising range of applica- tions that can benefit from these approaches, we hope to motivate a broader research program in this area.

1. Motivation, Hypothesis, Relevance

Increasingly, infrastructure services comprise not only routing, but also application-level resources such as search engines [15], adaptation proxies [8], and Web caches [20]. These applications must confront the same 24  7 opera- tional expectations and exponentially-growing user loads as the routing infrastructure, and consequently are absorbing comparable amounts of hardware and software. The current trend of harnessing commodity-PC clusters for scalability and availability [9] is reflected in the largest web server in- stallations. These sites use tens to hundreds of PC’s to de- liver 100M or more read-mostly page views per day, pri- marily using simple replication or relatively small data sets to increase throughput. The scale of these applications is bringing the well- known tradeoff between consistency and availability [4] into very sharp relief. In this paper we propose two gen- eral directions for future work in building large-scale ro- bust systems. Our approaches tolerate partial failures by emphasizing simple composition mechanisms that promote fault containment, and by translating possible partial failure modes into engineering mechanisms that provide smoothly-

degrading functionality rather than lack of availability of the service as a whole. The approaches were developed in the context of cluster computing, where it is well accepted [22] that one of the major challenges is the nontrivial software engineering required to automate partial-failure handling in order to keep system management tractable.

2. Related Work and the CAP Principle

In this discussion, strong consistency means single- copy ACID [13] consistency; by assumption a strongly- consistent system provides the ability to perform updates, otherwise discussing consistency is irrelevant. High avail- ability is assumed to be provided through redundancy, e.g. data replication; data is considered highly available if a given consumer of the data can always reach some replica. Partition-resilience means that the system as whole can sur- vive a partition between data replicas. Strong CAP Principle. Strong C onsistency, High A vailability, P artition-resilience: Pick at most 2. The CAP formulation makes explicit the trade-offs in designing distributed infrastructure applications. It is easy to identify examples of each pairing of CAP, outlining the proof by exhaustive example of the Strong CAP Principle:

 CA without P: Databases that provide distributed transactional semantics can only do so in the absence of a network partition separating server peers.

 CP without A: In the event of a partition, further trans- actions to an ACID database may be blocked until the partition heals, to avoid the risk of introducing merge conflicts (and thus inconsistency).

 AP without C: HTTP Web caching provides client- server partition resilience by replicating documents, but a client-server partition prevents verification of the freshness of an expired replica. In general, any dis- tributed database problem can be solved with either expiration-based caching to get AP, or replicas and ma- jority voting to get PC (the minority is unavailable).

In practice, many applications are best described in terms of reduced consistency or availability. For ex- ample, weakly-consistent distributed databases such as Bayou [5] provide specific models with well-defined consis- tency/availability tradeoffs; disconnected filesystems such as Coda [16] explicitly argued for availability over strong consistency; and expiration-based consistency mechanisms such as leases [12] provide fault-tolerant consistency man- agement. These examples suggest that there is a Weak CAP Principle which we have yet to characterize precisely: The stronger the guarantees made about any two of strong consistency, high availability, or resilience to partitions, the weaker the guarantees that can be made about the third.

3. Harvest, Yield, and the CAP Principle

Both strategies we propose for improving availability with simple mechanisms rely on the ability to broaden our notion of “correct behavior” for the target application, and then exploit the tradeoffs in the CAP principle to improve availability at large scale. We assume that clients make queries to servers, in which case there are at least two metrics for correct behavior: yield , which is the probability of completing a request, and harvest , which measures the fraction of the data reflected in the response, i.e. the completeness of the answer to the query. Yield is the common metric and is typically mea- sured in “nines”: “four-nines availability” means a comple- tion probability of 0 : 9999. In practice, good HA systems aim for four or five nines. In the presence of faults there is typically a tradeoff between providing no answer (reduc- ing yield) and providing an imperfect answer (maintaining yield, but reducing harvest). Some applications do not toler- ate harvest degradation because any deviation from the sin- gle well-defined correct behavior renders the result useless. For example, a sensor application that must provide a binary sensor reading (presence/absence) does not tolerate degra- dation of the output.^1 On the other hand, some applica- tions tolerate graceful degradation of harvest: online aggre- gation [14] allows a user to explicitly trade running time for precision and confidence in performing arithmetic aggrega- tion queries over a large dataset, thereby smoothly trading harvest for response time, which is particularly useful for approximate answers and for avoiding work that looks un- likely to be worthwhile based on preliminary results. At first glance, it would appear that this kind of degra- dation applies only to queries and not to updates. However, the model can be applied in the case of “single-location” updates: those changes that are localized to a single node (or technically a single partition). In this case, updates that

(^1) This is consistent with the use of the term yield in semiconductor man- ufacturing: typically, each die on a wafer is intolerant to harvest degrada- tion, and yield is defined as the fraction of working dice on a wafer.

affect reachable nodes occur correctly but have limited vis- ibility (a form of reduced harvest), while those that require unreachable nodes fail (reducing yield). These localized changes are consistent exactly because the new values are not available everywhere. This model of updates fails for global changes, but it is still quite useful for many prac- tical applications, including personalization databases and collaborative filtering.

4. Strategy 1: Trading Harvest for Yield—

Probabilistic Availability

Nearly all systems are probabilistic whether they real- ize it or not. In particular, any system that is 100% avail- able under single faults is probabilistically available overall (since there is a non-zero probability of multiple failures), and Internet-based servers are dependent on the best-effort Internet for true availability. Therefore availability maps naturally to probabilistic approaches, and it is worth ad- dressing probabilistic systems directly, so that we can un- derstand and limit the impact of faults. This requires some basic decisions about what needs to be available and the ex- pected nature of faults. For example, node faults in the Inktomi search engine remove a proportional fraction of the search database. Thus in a 100-node cluster a single-node fault reduces the har- vest by 1% during the duration of the fault (the overall har- vest is usually measured over a longer interval). Implicit in this approach is graceful degradation under multiple node faults, specifically, linear degradation in harvest. By ran- domly placing data on nodes, we can ensure that the 1% lost is a random 1%, which makes the average-case and worst- case fault behavior the same. In addition, by replicating a high-priority subset of data, we reduce the probability of losing that data. This gives us more precise control of har- vest, both increasing it and reducing the practical impact of missing data. Of course, it is possible to replicate all data, but doing so may have relatively little impact on harvest and yield despite significant cost, and in any case can never ensure 100% harvest or yield because of the best-effort In- ternet protocols the service relies on. As a similar example, transformation proxies for thin clients [8] also trade harvest for yield, by degrading results on demand to match the capabilities of clients that might otherwise be unable to get results at all. Even when the 100%-harvest answer is useful to the client, it may still be preferable to trade response time for harvest when client- to-server bandwidth is limited, for example, by intelligent degradation to low-bandwidth formats [7].

tures such as security or robustness to legacy applications that were designed without these features in mind, without requiring special changes to the core application code. The safety-critical systems community has also been using or- thogonal mechanisms for some time: the mechanical inter- locks removed from the Therac-25 radiation therapy ma- chine unmasked a software race condition that ultimately led to patient fatalities [18]. This and similar examples con- stitute abundant (if anecdotal) support for the design princi- ple of simple failsafe mechanisms with small state spaces; our contribution is the identification of this collection of techniques and the potential synergy of pairing them with compile-time orthogonal composition as strategies for im- proving robustness.

6. Discussion and Research Agenda

We presented two implemented examples of mapping harvest degradation onto specific mechanisms that provide engineering tractability, availability through redundancy, or some other desired operational feature. In the case of the Inktomi search engine, per-node timeout constraints keep the overall system yield constant at the expense of prob- abilistic harvest degradation. In general, it maps faults to degradation in harvest rather than yield, thus providing probabilistically good answers essentially all the time (al- though the yield cannot be 100%). In the case of the SNS cluster-based application server, the constraint that applica- tion modules must be restartable allows the use of simple scaling and reliability mechanisms, including orthogonal mechanisms such as timeouts and retries, and the restarta- bility constraint is addressed by composing the applica- tions with orthogonal state maintenance mechanisms such as SRM. Specific mechanisms we have been able to exploit to simplify engineering and improve robustness or scalabil- ity include:

 Simple mechanisms with small state spaces whose be- haviors are easy to reason about: timeout-based par- tial failure handling, guard timers, orthogonal secu- rity, etc., inspired by orthogonal mechanisms in safety- critical systems.

 The orthogonalization of these mechanisms with re- spect to application logic, separating the application functionality from the provision of high availability. The composition of SNS and SRM provide a good il- lustration of this approach.

 The replacement of hard state with refreshable soft state, which often has the beneficial side effect of making the recovery code the same as the mainline code. The load balancing manager in SNS works this

way [2], using refreshable soft state mechanisms in- spired by IP multicast routing and SRM state repair.

 Overall tractability of large-scale engineering involv- ing hardware replication and redundancy. Only a few very expensive specialized systems, such as Teradata’s 768-node data mining cluster [21], really compare in size and aggregate capacity to cluster-based Internet services.

It remains to formally characterize applications that tol- erate graceful harvest degradation, including as a special case those applications composed of degradation-intolerant and possibly orthogonal subsystems. We expect that a for- mal characterization will induce a programming model that provides first-class abstractions for manipulating degraded results. A formally-characterizable framework for deploy- ing such applications would then amount to a constructive proof of the Weak CAP Principle. Traditionally, an application and system designed with incremental scalability and high availability in mind have differed from their counterparts designed without respect to these constraints. We have found that despite their sim- plicity, the engineering techniques we used in the design and construction of the above example applications have afforded surprising flexibility in the range of applications that can be built. Simple techniques were chosen in order to simplify the formidable programming task, and techniques with good fault isolation were favored in order to preserve the fault isolation advantages already inherent in clusters. In particular, the SNS server showed that it is possible to sep- arate scalability and availability concerns from the design of mainline applications if the application structure can be reconciled with the design constraints imposed by the use of simple and orthogonal mechanisms. We would like to motivate a broader research effort that extends these observations, resulting in a set of design guidelines for the construction of large-scale robust applica- tions spanning the range from ACID to BASE [9]. We offer the initial observations here as a first step in that direction. We thank the anonymous reviewers for their comments on the first draft and our colleagues at Stanford and Berke- ley for being sounding boards for these early ideas.

References

[1] F. Brooks. The Mythical Man-Month: Essays on Software Engineering. Addison–Wesley, 1975 (revised 1995). [2] Y. Chawathe and E. A. Brewer. System support for scal- able and fault tolerant internet service. In IFIP International Conference on Distributed Systems Platforms and Open Dis- tributed Processing (Middleware ’98) , Lake District, UK, Sep 1998.

[3] C. Cowan, C. Pu, D. Maier, J. Walpole, P. Bakke, S. Beattie, A. Grier, P. Wagle, and Q. Zhang. StackGuard: Automatic adaptive detection and prevention of buffer-overflow attacks. In Seventh USENIX Security Symposium (Security 98) , San Antonio, TX, January 1998. [4] S. B. Davidson, H. Garcia-Molina, and D. Skeen. Consis- tency in partitioned networks. ACM Computing Surveys , 17(3), 1985. [5] A. Demers, K. Petersen, M. Spreitzer, D. Terry, M. Theimer, and B. Welch. The Bayou architecture: Support for data sharing among mobile users. In Proceedings of the 1994 Workshop on Mobile Computing Systems and Applications , December 1994. [6] S. Floyd, V. Jacobson, C. Liu, and S. McCanne. A Reliable Multicast Framework for Light-Weight Sessions and Appli- cation Level Framing. In ACM SIGCOMM ’95 , pages 342– 356, Boston, MA, Aug 1995. [7] A. Fox and E. A. Brewer. Reducing WWW Latency and Bandwidth Requirements via Real-Time Distillation. In Fifth International World Wide Web Conference (WWW-5) , Paris, France, May 1996. WOrld WIde WEb Consortium. [8] A. Fox, S. D. Gribble, Y. Chawathe, and E. A. Brewer. Adapting to network and client variation using active prox- ies: Lessons and perspectives. IEEE Personal Communi- cations (invited submission) , Aug 1998. Special issue on adapting to network and client variability. [9] A. Fox, S. D. Gribble, Y. Chawathe, E. A. Brewer, and P. Gauthier. Cluster-Based Scalable Network Services. In Proceedings of the 16th ACM Symposium on Operating Sys- tems Principles , St.-Malo, France, October 1997. [10] A. O. Freier, P. Karlton, and P. C. Kocher. SSL version 3.0, March 1996. Internet Draft, available at http://home. netscape.com/eng/ssl3/ssl-toc.html. [11] I. Goldberg, D. Wagner, R. Thomas, and E. A. Brewer. A se- cure environment for untrusted helper applications: confin- ing the wily hacker. In 1996 USENIX Security Symposium ,

[12] C. G. Gray and D. R. Cheriton. Leases: An efficient fault-tolerant mechanism for distributed file cache consis- tency. Technical Report CSL-TR-90-409, Stanford Univer- sity Dept. of Computer Science, January 1990. [13] J. Gray. The transaction concept: Virtues and limitations. In Proceedings of VLDB , Cannes, France, September 1981. [14] J. M. Hellerstein, P. J. Haas, and H. J. Wang. Online ag- gregation. In ACM–SIGMOD International Conference on Management of Data , Tucson, AZ, May 1997. [15] Inktomi Corporation. The Inktomi technology behind HotBot, May 1996. http://www.inktomi.com/ whitepap.html. [16] J. J. Kistler and M. Satyanarayanan. Disconnected Opera- tion in the Coda File System. ACM Transactions on Com- puter Systems , 10(1):3–25, February 1992. [17] N. G. Leveson. Safeware: System Safety and Computers. Addison-Wesley, 1995. [18] N. G. Leveson and C. S. Turner. An investigation of the therac-25 accidents. IEEE Computer , July 1993. [19] S. McCanne, E. Brewer, R. Katz, L. Rowe, E. Amir, Y. Chawathe, A. Coopersmith, K. Mayer-Patel, S. Raman, A. Schuett, D. Simpson, A. Swan, T.-L. Tung, D. Wu, , and

B. Smith. Toward a common infrastructure for multimedia networking middleware. In 7th Intl. Workshop on Network and Operating Systems Support for Digital Audio and Video (NOSSDAV 97) , St. Louis, MO, May 1997. Invited paper. [20] National Laboratory for Applied Network Research. The Squid internet object cache. http://squid.nlanr.net. [21] NCR Corp. Teradata scalable RDBMS. http://www3. ncr.com/teradata. [22] G. F. Pfister. In Search of Clusters (revised ed.). Addison- Wesley, 1998. [23] A. Schuett, S. Raman, Y. Chawathe, S. McCanne, and R. Katz. A soft state protocol for accessing multimedia archives. In NOSSDAV 97 , 1997. [24] R. Wahbe, S. Lucco, T. E. Anderson, and S. L. Graham. Efficient Software-Based Fault Isolation. In Proceedings of the 14th ACM Symposium on Operating Systems Principles ,