Saturday, February 7, 2009

eBay Scaling Odyssey and All I Need is Scale

These are two very interesting slide sets on web application design principles and cloud computing at eBay. Building a web application that serves 2 billion page views per day and manages transactions with real money ($60 billion per year) is definitely nontrivial, especially if you have to balance reliability and performance with "feature velocity" and adaptability (the ability to constantly upgrade the product). Is it a real problem? Heck yeah. I think that supporting rapid evolution is one of the most underestimated aspects of web application development in the research community, and one of the main challenges in practice. I've seen this during my internship at Facebook too. It's nice that the presentations point out this problem right away. Evolvability is also one of the things that it's hardest to plan for when building a web application, especially given the need to constantly push out features to compete, and it gets harder and harder as your application grows. Having a set of guiding principles to follow from day 1 is very helpful.

The five principles the slides point out are familiar to anyone who's read about GFS, Dynamo, MapReduce, etc. It's nice to see consensus! The most surprising one to me was that eBay uses machine learning for automation, although this seemed to be more for the search side than the operations side.

The design patterns provide some good ideas as well. While I didn't fully understand the point of the scalable multicast and event queue patterns from the slides, I really liked the idea of a global message bus with logging to deal with failures, and of rollback. This reminds me of some of the elements of the Facebook architecture - for example, a common RPC format, Thrift, for service interactions, along with an RPC logging layer (Scribe). However, the Facebook architecture is somewhat different because you don't have a very clear concept of independent services yet, whereas eBay seems to be a more traditional SOA.

Their view on clouds is pretty promising - although they identify some "faux PaaS", they are actually considering using external cloud providers. This provides a strong case for cloud computing. One difference between eBay and other web applications though is that much of the data on eBay is public, so for example putting a search service in the cloud does not introduce a risk of losing consumer data. If a company like Facebook wanted to put services in the cloud on the other hand, they'd have to think very carefully because most of the site is private information.

Finally, the presentations also do a good job talking about tradeoffs. They mention CAP directly, and they say that they go for the A and P as much as possible. They also talk about the friction between performance, reliability etc and extensibility, though they don't try to say that this is an unavoidable tradeoff.

Tuesday, February 3, 2009

A Policy-Aware Switching Layer for Data Centers

Problem: Managing an enterprise or data center network is difficult because middleboxes must be placed on the path of the traffic they must filter. The authors argue that this is a real problem using statistics about data center downtime. My only question here is just how many middleboxes are really used in a typical data center - it would seem that some services don't use that many and won't benefit so much from this work.

Solution: Allow policies to be specified centrally and programmed onto switches, letting them route traffic through middleboxes in the correct order.

Why is it different from previous work? This seems to be the first paper really looking at this problem from a network architecture point of view rather than trying to hack together a solution using existing network hardware features.

Will it be influential in 10 years? I think this paper makes a good point for higher-level policy control over the network and a smarter switching layer, as well as perhaps packet tagging as a primitive. Other network research (e.g. OpenFlow) tries to achieve similar goals of a programmable switching layer.

Criticism: The need to preserve integrity while switching between policy complicates things and to some extent seems to be a good opportunity to design clever algorithms. Would it be possible to take another approach where you drop or delay packets for a bit but make the switchover very fast?


DCell: A Scalable and Fault-Tolerant Network Structure for Data Centers

Problem: Data center networks have low bisection bandwidth and high cost (as in the previous paper).

Solution: A new topology called D-cell consisting of a hierarchy of self-similar structures, plus a fault-tolerant routing algorithm over it. The nugget is the ability to set up many potential paths between nodes and sometimes use a suboptimal one to get good load balancing, fault tolerance, scalability and incremental deployability.

Why is it different from previous work? The main differences in goals were high scale (up to millions of servers, not thousands), fault tolerance, and incremental deployability (so you can build out a data center rack by rack). While the authors don't spend too much time going into detail about why each of the previously studied topologies was inadequate, they claim they are the only solution that achieves all these goals.

Will it be influential in 10 years? It's hard to tell whether such a paper can be the end-all of data center topologies. Certainly the paper brings the problem of data center networking to the attention of the community and will be influential in that way, but some of the design choices seem arbitrary (there is no overarching structure to D-cell) and it is probably possible to improve over it in various areas.

Criticism: The paper is pretty confusing to read. More diagrams and less text would have been extremely helpful! As it is, you kind of have to trust the authors as you go through.

Other: It's very interesting to compare this paper with the fat-tree paper at the same SIGCOMM. Some of the assumptions in D-cell are very different:
  • Nodes have multiple links (albeit a fixed number) and participate in routing. (Of course, we could replace each node by a switch managing a number of nodes, but they seem to believe that nodes will be machines).
  • There is a lot less economics in the D-cell paper and a lot more math (e.g. no look at wiring complexity). It does not seem quite as pragmatic as the fat-tree proposal (since it requires special hardware and software at all nodes) and seems more "clean-slate". Since this is a paper from MSR, maybe they are considering custom switches and thus more open to radical changes in hardware.
  • However, the D-cell paper also appears to avoid the need for centralized scheduling as in the fat-tree paper, although the authors never really talk about this issue or about maintaining packets in order.
  • While the fat-tree paper tries to achieve full bisection bandwidth, D-cell only gets O(N / log N). They seem to be content with this, whereas the UCSD paper argues that oversubscription of even 2.5:1 is bad.

A Scalable, Commodity Data Center Network Architecture

The problem: Data center networks are expensive and achieve poor bisection bandwidth due to their use of a tree topology with non-commodity switches at the highest levels. This is definitely a real problem - applications like Hadoop have to try to keep communication within a rack and are bound by network performance.

Solution: Use commodity switches in a fat tree topology, with a centralized scheduler to achieve load balancing.

How it differs from previous work: These kinds of topologies have been used before in high-performance computing. The new element here is trying to use them for Ethernet/IP/TCP so that apps don't have to be changed and commodity switches can be used. In particular, the authors want to maintain the ordering property of conventional LAN topologies to have TCP perform well.

Tradeoffs / criticism: At first sight there seems to be a tradeoff between preserving packet ordering and achieving high bisection bandwidth using commodity elements. However, we know that using random paths we can do pretty well if we give up strict ordering guarantees. What exactly is the potential variation in latency that would be added by a reordering buffer in front of TCP? Might it not be fine to incur this? It seems much more attractive to modify host OSes a little bit than to require a centralized scheduler which is a central point of failure and is tailored to specific assumptions about traffic patterns (e.g. they say they assume each host has only 1 large flow coming out of it).

Long-term impact: This paper definitely puts data center topologies in the spotlight and provides an economic argument for using commodity switches. While the solution presented here may not be the best one, it's not inconceivable that the idea of using commodity switches will stick around for a while.

Sunday, February 1, 2009

Designing a highly availabile directory service

This reading is a chapter from Sun's Java System Directory Service manual about how to set up a replication topology for reliability. To understand it fully, a bit of background is needed from the other chapters:
  1. The role of a directory service is to store key-value pairs within some directory of suffixes, for a read-mostly workload. The keys and values are both small.
  2. Sun's directory service can run in three modes: master, hub and consumer. A consumer is read-only cache and is updated by another server. A hub is similar to a consumer but its purpose is to push updates from a master to multiple consumers. Finally, a master performs writes as well as reads.
The article starts with a description of backup mechanisms available in Directory Service. There is a fast coarse-grained binary backup that only works on identical machines, and a structured data (LDIF) backup that can be restricted to parts of a data set and can be loaded on any machine. This shows what might be a fundamental tradeoff between performance and flexibility of backup mechanisms: binary snapshots are very easy to take, but keep data in a machine-dependent, non-portable and difficult-to-subdivide format. Standard formats are more portable and future-proof but require more work to write. The guide recommends using both types of backups (having a binary one locally and on similar machines only).

The article then goes into some sample topologies for various scenarios. The single-datacenter scaled for read performance is the first complex one, and it is very interesting because it contains a detailed analysis of possible faults, including link faults. We see why having hubs and multiple redundant links (e.g. a link from each master to each hub) is useful for dealing with the various failures. The two-datacenter example in addition mentions that you want to have two independent links between data centers, as well as "backup agreements" that are disabled for the case when more than one master fails. Finally, when we get up to five data centers, we see an interesting limitation of the software: the software supports only up to 4 masters. Presumably this is because they need to run a consensus protocol, and consensus protocols don't scale very well beyond this level. This is an interesting disadvantage of consensus protocols that we haven't seen in many cloud computing papers and might represent a fundamental tradeoff between performance and availability due to latency of network links, etc.

Overall this reading is especially interesting because it comes from a highly available enterprise system, not from the web company perspective behind many cloud papers. Enterprises are serious about availability and it shows in this detailed user guide. Failure scenarios are carefully examined and best practices are described. Equally interesting is the fact that Directory Service is a product which external administrators need to be trained to use through a manual (and courses presumably), so it needs to not only be reliable but be administrable by someone who is not a designer of the original system. Cloud software (Hadoop, Ruby on Rails, etc) rarely comes with instructions this good often and requires experienced personnel to manage it.

Failure Trends in a Large Disk Drive Population

This detailed measurement study looks at more than 100,000 disk drives at Google that were monitored throughout their lifetime to quantify failure rates and attempt to identify warning signs for failure. The most interesting aspect of this study, which also sets it apart from similar studies, is methodology: Google built a lightweight health monitoring system at least 5 years prior to this paper, collected monitoring data into a large-scale data store (BigTable), and analyzed it using large-scale analysis tools (MapReduce/Sawzall). For a data center operator, one lesson from this paper is that it may help to monitor not only software but also hardware you purchase in order to guide future purchasing and design decisions.

The findings are fairly detailed, but the most surprising ones are:
  • Heat seems to have little adverse effect on drives, and in fact higher temperatures seem to help reduce failures up to a point.
  • Utilization also has little adverse effect.
  • While SMART parameters are correlated with failures, they are not enough to predict failures with reasonable reliability.
It is also interesting how many weird types of spurious data points were found, such as drives reporting higher temperatures than the surface of the sun. Any large-scale statistical analysis needs to watch out for such errors in the data/monitoring.

One potential long-term impact of this work is that it encourages more cloud vendors to collect health databases about various computer components. With companies the size of Google collecting such data, users get a better picture of real-world reliability of the hardware than from manufacturer testing or manufacturer problem databases.

Data Center Failure As A Learning Experience

This short article emphasizes the need to plan for failure when designing a company's data center (or data centers). The main idea, which is somewhat provocative at first sight, is that you can't design for 100% uptime so you might as well ensure that failure is "small" (isolated) and recoverable. This is somewhat reminiscent of Eric Brewer's point in his "lessons from large-scale systems" work that mean time to recover (MTTR) is more important than mean time to failure (MTTF).

The other interesting idea in the article is that hardware failures tend to happen either shortly after installing hardware ("infant mortality") or as it wears down towards the end of its life cycle ("old age"). Thus it's important to wear in newly bought hardware for some amount of time to weed out the equipment that will fail early.