Sunday, May 3, 2009

Power Readings

These short readings focused on two issues: PUE and CPU advances.

PUE

The problem addressed here is how to begin quantifying data center energy efficiency with a simple metric. The authors propose PUE, defined as (total energy consumption) / (energy consumption of IT equipment). Typical PUEs are approximately 2, meaning there is one Watt of overhead for every Watt that makes it to a server. The authors show that PUE has been going up due to energy prices increasing, and so it is more and more important to use efficient cooling and energy distribution technology.

PUE is certainly a useful metric for determining "infrastructure overhead", especially because this overhead may be easier to decrease than buying new servers. However, another useful metric is "energy per unit work", or even "energy per unit profit". These are the ones that will ultimately determine whether it's more worthwhile to upgrade data center infrastructure, upgrade servers, or just focus on the application instead of worrying about power. The CERN/Intel article looks at some of these issues.

CPU Advances

This article is mainly marketing material from Intel about the virtues of its newer lines of chips. It's interesting because they quote concerns and solutions from CERN. Basically, the power savings benefits of newer Intel chips fall into two categories:
  1. Multicore: This development saves power first by putting more CPU into the same physical area (same amount of rack space etc), amortizing the cost of other computer components. Second, decreasing frequencies and adding more cores improves performance-per-Watt because performance drops linearly with frequency but power drops quadratically (or cubically?). This is a very interesting effect that's actually also being exploited in cell phones and in radical computer designs like CMU's FAWN. It will be interesting to see just how far this might be pushed - will some cloud applications run on ARM nodes, or will the overhead of more cores just be too much to make this worthwhile?
  2. Virtualization: This technology saves power by enabling consolidation of low-utilization machines. However, the article rightly points out that virtualization may not make sense for resource-intensive applications because it will just add overhead and increase power cost. This technology is probably not as important to CERN as multicore, but might be important to many enterprises who have a bunch of low-utilization boxes lying around.
Finally, one interesting point in the article was the constraint of floor space and data center building design that CERN was facing. Organizations can't just move to a new data center without incurring high costs. Multicore and virtualization both save space, not just power, so that was one of the other reasons CERN was looking at them. This is one area in which cloud providers may have an advantage, by buying cheap land and designing data center buildings to enable the fancier cooling technologies that were not possible at CERN.

Sunday, April 26, 2009

BOINC

Problem: Really large scientific computations.

Is it real? No matter how fast computers get, we seem to find more computations to run on them.

Nugget: Distribute the computation to regular computer users through a client-side platform that runs when the computer is idle (e.g. as a screensaver) and incentivizes users by providing a nice UI and a count of how much they are contributing to the project. The paper describes a lot of neat features that went into BOINC to make it easy for scientists and attractive for users of various levels (enthusiasts vs. average coputer users).

Influence: SETI@home is very popular (although no aliens have been found yet!) and other projects also seem to have made a significant amount of progress using BOINC. It's a good idea. The lessons learned with respect to building a system that real computer users will want to participate in are also great.

Criticism: Interestingly, BOINC is perhaps the least power-efficient way possible to get really massive parallel computations (compared to a data center or to a supercomputer).

BitTorrent

Problem: Distributing a large file to multiple users.

Is it real? Yes, and in fact some real large-scale apps that are not file-sharing sites, such as World of Warcraft, use BitTorrent to distribute software updates.

Nugget: A peer-to-peer protocol that lets peers fetch pieces of the file on separate connections from various peers and reciprocate by uploading other pieces to them. The rarest-first rule and the choking/unchoking algorithms are what really contribute to BitTorrent's efficiency.

Criticism: Although BitTorrent undeniably works great, one has to wonder how much of this is due to users not modifying their clients as opposed to the design of the protocol. Even if there are a few abusive leechers, BitTorrent will do fine. However, if a substantial number of peers tried to download without uploading, there would be problems. The game theory behind the prisoner's dilemma shows that even in this situations, peers might choose a tit-for-tat strategy, which is nice. However, because not many users are very abusive today, we don't know how well the protocol will handle having a significant fraction of users beeing selfish from the paper.

Measuring and Evaluating Large-Scale CDNs

Problem: How can we compare content distribution networks for performance and availability?

Is it important? Most major websites are probably interested in the results. It's interesting to ask what they use to make the decision on hosts however; this study is done purely from the outside, but CDNs must have internal performance metrics they present to potential customers.

Nugget: Use DNS from a large list of open recursive DNS servers to identify the servers in each CDN and measure latencies to them from a large number of geographical locations. The particular technique used comes from a system called King. To measure the latency from an open recursive DNS server D to a target server T, one first uses a domain one owns to install a name server entry for a subdomain with T's IP address listed as the name server. One then tries to make a query for this subdomain through D, thus causing D to send a message to T and receive a reply. There were also other neat pieces of methodology in the paper, such as using a list of logs from MSN Live to find a large number of open recursive DNS servers.

Results: The paper compares Akamai with Limelight and finds a number of interesting differences between them, largely resulting from their different architectures. Akamai has many small clusters of servers in ISPs, while Limelight has a few larger clusters each of which are placed near a number of ISPs at the same time. We see the following high-level results:
  • Akamai has more servers in total by nearly (~25K versus ~5K).
  • Akamai's services are more geographically distributed (e.g. Limelight has none in Oceania and only 3 in Asia).
  • Individual Akamai servers have lower availability (although it's not clear whether availability for the service as a whole is affected), presumably because there are more of them so they are harder to manage.
  • Akamai has lower 95th percentile latency across the whole suite of tests (from each of the locations with open recursive DNS servers). However, interestingly, Limelight does very well within particular regions, beating Akamai in North America and Europe. The difference seems to be mainly due to Limelight not having focused so much on Asia and Oceania yet, so perhaps its approach will work fine as it evolves.
Finally, the main thing missing in the paper is a study of throughput. This was not possible to do through the open DNS server technique, but it would've been valuable to try a few measurements from a smaller number of sites (e.g. PlanetLab).

Monday, April 20, 2009

WheelFS

Problem: Distributed storage.. in particular, making it easy to program and making it possible for legacy applications to use distributed storage systems.

Is it real? Definitely.

Nugget: WheelFS looks like a standard POSIX file system, but allows specification of distributed storage policies like consistency, primary replica, hints about read patterns, etc to be specified as "cues" in path names.

Will it be influential? The idea of putting hints about consistency/etc properties into "cues" in a path is neat and can probably benefit other systems. Using FUSE to achieve a POSIX-like file system interface and allow legacy apps to run on top is a win; Hadoop's HDFS does this too (sort of) as of recently, and I imagine that other people writing distributed FS'es will do it. The main question with respect to influence of this work will be whether WheelFS will prove flexible and efficient enough for applications beyond the ones it was evaluated with.

Criticism: One general question with a general system like WheelFS is whether a single system can be optimal for all applications. Common engineering sense says that the answer is probably no (although maybe the *API* of WheelFS could be used for other apps). The next question then is, what are the limitations of WheelFS? Can we say which apps it will be good for and which apps it won't?

Scaling Out

Problem: Facebook needed multiple datacenters for reliability and performance (latency).

Importance: Relevant to everyone who hosts an Internet service.

Solution: The most interesting thing about this article is the fairly pragmatic use of existing technology rather than reinventing data center storage from scratch, which allowed them to deploy a second data center relatively quickly. The biggest "trick" or "nugget" is the extension to MySQL to cause it to invalidate caches when replication pushes a database change over, maintaining the invariant that MySQL never contains older data than memcached. The other interesting idea is read-your-own-writes by redirecting users to the California data center after a write.

Is it influential? Sure, many web companies use a similar strategy. The article clearly points out some of the issues that need to be taken into account when you have replication and caching together.

Criticism: The main problem with this article's approach is the flip side to the nugget - by using some simple hacks on existing technology (MySQL, memcached, load balancing) we might be missing out a more general, less hacky solution. Already the solution in the article only supports writes at one data center, for example. The worrying about memcached and MySQL at the application level is a serious concern for anyone interested in ease of programming and bug prevention in Internet services as well. Projects like SCADS try to take a more general and clean-slate approach to these problems.

Wednesday, April 15, 2009

AppDrop and portable cloud computing

The nugget in the AppDrop is that a higher-level cloud computing API (AppEngine) can be emulated on top of a lower-level cloud computing API (EC2). AppDrop achieves this with very little effort by just running Google's local-machine test environment for AppEngine on EC2.

Unfortunately, it punts on the most interesting part of AppEngine, which is scalability, especially of the data store. Although many of the blog comments say "it shouldn't be too hard to get this to run over MySQL" or even propose using HBase, I don't think anyone has done this yet.

Part of the problem might have been that running small Python apps written against a Google API was just not that compelling that companies would want to do it on multiple providers. Google App Engine has gotten much more interesting recently, however, by supporting Java. It does this through standard J2EE APIs, meaning that one can actually envision taking a serious J2EE app now and running it on AppEngine, EC2, etc. Existing J2EE storage layers are more scalable than the little AppEngine test environment used in AppDrop, so one could imagine running these apps scalably on EC2 or private clouds. However, there will still be a serious problem of sharing data across clouds.

Open Cloud Manifesto

The Open Cloud Manifesto is a good summary of some of the value propositions and potential obstacles to cloud computing. Nothing inside is absolutely revolutionary, but listing the topics in one place is useful. The main thesis of the manifesto is that cloud providers should attempt to define open standards for clouds to enable users to truly treat them as utilities. This is a good idea, and might happen anyway through market forces, but the interesting thing is that none of the major cloud providers (Amazon, Google and Microsoft) has signed the manifesto. There are probably politics involved that don't fully come out in the writing.

Tuesday, March 31, 2009

Erlang

I'm grouping all three readings into one blog post because they're all perspectives on the same thing.

Problem: Writing reliable, scalable, industrial-grade distributed systems. Not an easy problem! And it's definitely real and becoming realer for more types of applications.

Solution/Nugget: Erlang has a lot of interesting features, but the main idea is to give you a more restrictive programming model provides good primitives for writing distributed apps but makes it hard to get into trouble. In other words, some tasks are easier if you tie one hand behind your back.

The actual model chosen by Erlang is actors communicating by asynchronous messages at the high level, and functional programming within an actor. The use of functional programming makes it easy to manage memory and prevents the programmer from getting into trouble with shared state (since variables are read-only). It's also nice for making program shorter, although Erlang syntax has problems too (see below). The use of actors makes it possible to treat different request handlers / etc as different entities in the program while sharing a small number of physical threads (kind of like the lightweight threads in Cappricio). It also real models networks directly, as messages may get lost, reordered, etc; applications or libraries can choose how to handle these cases. Most importantly, actors are independent units of failure. Along with Erlang's error reporting and process supervision mechanism, this lets multiple modules with potentially buggy code coexist within one runtime and survive crashes of some of the actors without taking down the entire system. The use of message passing and functional programming is also what makes it easy to do garbage collection and runtime code replacement, because the interfaces between executing processes are clean.

Why is the solution different from previous work? It actually works: people have built large systems with many nines of availability out of it. This derives from the fact that Erlang started out in a very reliability and scalability conscious environment -- a telecom -- and added a minimal set of features to make programming distributed systems easier. The result is a language that might not fit nicely into most traditional programming paradigms (it's not really purely functional for example) but gets the job done. Most importantly, Erlang takes into account "production" issues like code replacement and isolating failures that many academic systems don't because academics are not as aware of these issues.

Fundamental tradeoffs: In designing programming languages, there seem to be two related tradeoffs:
  1. Performance versus conciseness: Languages with high-level programming features like functional programming, dynamic typing and pattern-matching generally can't perform as well as languages that give you direct access to memory and an easy way to map your program onto CPU instructions. However, they do give you conciseness and as a result more debuggability and testability. Erlang opts for conciseness.
  2. Range of features versus reliability/predictability: Both high and low level languages can have broad or narrow feature ranges. For example, C++, a "low-level" language according to the definition above, nonetheless allows all kinds of programming paradigms (OOP, functional [sort of], procedural, generic, etc). Ruby, a more "high-level" language, also offers all of these. These languages seem great when you learn them because they let you use a wide range of programming styles, but in doing this, they give you more opportunity to shoot yourself in the foot and they also become very hard for compliers and runtimes to analyze. In contrast, Erlang is a high-level language with a restricted feature set. The restrictions make it easier to debug Erlang programs and to run them reliably, at the cost of removing some programmer flexiblity. SQL is another high-level language with restricted feature set, although it doesn't have quite the predictability benefits of Erlang because it is declarative. I actually don't know any low-level language with restricted feature set but the way Google uses C++ for example is to restrict usage of the crazier/harder-to-debug features.
The interesting conclusion from this taxonomy is that it isn't just a three-way tradeoff between performance, abstraction and predictability. Abstraction can be both helpful and harmful for predictability. In the Erlang case, it's helpful, but in SQL, which is also very abstract, it's hard to predict performance. This is why I tried to split up abstraction into conciseness and range of features, although these aren't great terms for the distinction I'm trying to make.

Is it influential? Yes, people at Amazon, Facebook and other companies are now using Erlang for web systems. New high-level languages like Scala also support Erlang's concurrency model.

Criticisms: While Erlang is a very neat system, it's also 20 years old, and some of the design decisions are really weird. In particular, Erlang syntax can be unnecessarily restrictive, and Erlang string processing is really inefficient because strings are represented as lists of 32-bit integers. This post by a CouchDB developer does a great job explaining Erlang's limitations. So does Chris Newcombe's presentation on Erlang.

Sunday, March 29, 2009

X-Trace

Problem: Collecting traces of applications composed of distributed components in different administrative domains. Is it real? Yes.

Solution/Nugget: Pass along just enough metadata to form a task tree, but log all trace events locally within each AD. One can then reconstruct the tree after the fact.

Why is it different from previous work? Mostly because it changes the problem by trying to work across ADs.

Tradeoffs: There seems to be a tradeoff in all tracing work between the amount of code modification required and the value of the information captured. One interesting thing here is that it might be possible to instrument a few middleware libraries to capture a wide variety of behavior (this is what Andy and I did with Hadoop). However, doing this for all existing apps is difficult. It might also be interesting to combine X-Trace with existing libraries/tools like log4j or DTrace and let those fill in some nodes on the DAG of events.

Will it be influential? Probably; there are signs that Microsoft and Google have similar systems.

Criticisms: It might have been nice to specify a formal X-Trace format in this work, to make it easier for applications to adopt it. George and Rodrigo have done this now, but if the paper had "productized" X-Trace a bit more, more apps might have been running it now.

DTrace

Problem: Instrumenting production systems to find performance issues while the system is running. Is it real? Yes, everyone has this problem.

Solution/Nugget: D-Trace provides a uniform, extensible API for instrumenting both kernel and user level behavior, letting the same tracing program access both. The D programming language for tracing scripts is also a novel contribution because it supports high-level programming constructs and easy access into kernel variables while keeping tracing code "safe".

Differences from previous work: D-Trace mostly differs because it combines a number of good ideas and good engineering practice. There were other systems that did particular pieces of D-Trace, but D-Trace managed to combine these into a single framework upon which a lot of instrumentation can be built.

Tradeoffs: There are certainly some tradeoffs mentioned between tracing performance, safety and power to collect data. D-Trace tries to enable the most types of analysis while providing strict guarantees for performance and safety. The language contains constructs like aggregates to make this easier.

One other aspect, which may or may not be a tradeoff, is that D-Trace is designed to be an "interactive" tool where you write a trace program for just the events you care about and run it. Other systems, like X-Trace, try to be a "capture" tool where you analyze data after the fact. This makes D-Trace fast and flexible but means that it cannot be used for post-mortem analysis of a problem. This is why the paper focuses on performance problems mostly (which occur chronically).

Will it be influential? Hopefully. It would be really great to have this as a standard API in Unix-like OSes. Right now D-Trace is one of the main advantages of using Solaris but can't be used in Linux because the license conflicts with the GPL.

Wednesday, March 18, 2009

Artemis, Chukwa and Scribe

I'm going to talk about these three together because they are very similar and need to be compared against each other. All three are frameworks for log collection and analysis in a data center.

The first difference is in the latency of analysis. All three frameworks are used primarily for offline analysis, but Scribe also supports close-to-realtime routing of messages through various servers. (The other two have some modules that scan files periodically and are therefore intrinsically higher-latency.) It seems that in general, anything based on monitoring files might be higher-latency and less aware of message boundaries than a system like Scribe where the app actively pushes messages.

A second difference is in pieces of the analysis stack provided. The articles jointly identify four components needed for log analysis:
  1. Some source of data (new instrumentation library in Scribe, or just collecting log files from existing libraries in Chukwa and Artemis).
  2. A system for collecting the logs centrally.
  3. A system for storing the logs.
  4. Analysis tools on top of the collected logs.
Artemis provides all four components, although 1 just uses existing logs. Chukwa provides 1-3 but lets you build 4 rather than attempting to have as detailed a library as Artemis. Scribe really only provides 1 and 2, and in fact requires you to do the plumbing for 1 if you want to use external data sources. The interesting thing however is the commonality in how the articles suggest you do 3 and 4 -- they all talk about using Hadoop or Dryad if your scale is sufficiently large. Unsurprisingly, log analysis is a good use case of Dryad and MapReduce.

Monday, March 16, 2009

Google Apps Security Review

This is a pretty serious document aimed at reassuring Google Apps users about the security of the services. As such, it probably contains a little bit of marketing on top of the technical content, but it's still very interesting to read to see all the issues they care about. This is certainly one of the most enterprisey documents you see from Google.

The document talks about multiple aspects of security, including physical security, data security, privacy, organizational/operational security (how the organization is designed so that security gets built into apps), and threat evasion (dealing with security problems when they do happen). The most interesting parts to me were the ones about development methodology: all new developers are trained about security (I went through some of this myself when I interned at Google), and all products are audited throughout the development process. The document rightfully points out that security must be designed into an application from the beginning and carefully managed thereafter; it can't be bolted on or "validated after the fact". Also interesting is the part about Google developing its web servers etc to only contain the outwards-facing features its apps need, rather than using something like Apache. This is a good way to make the code smaller and more auditable.

One of the points I didn't agree with was about Google's internal infrastructure making it hard to find user data even if someone does break in - for example, because data is distributed among multiple servers. I find this hard to believe. If someone breaks into the Google intranet, they also find all the developer documentation including API docs on how to read/write data from the storage systems. They can use these to find the relevant data. This argument sounds to me like security through obscurity. I'm sure however that there are other systems on top of the infrastructure that provide more protection beyond hoping that someone just won't figure out where the replicas of a given block are.

Azure Writeups

These writeups do a good job explaining the components of Azure, although they still leave many questions annoyingly unanswered. There seem to be four components:
  • Windows Azure: runs applications in an EC2-like manner. There seem to be two types of apps allowed (both .NET for now): "workers" which do background processing and "web" apps which serve requests. This immediately seems kind of restrictive, but it also gives Microsoft good hints about how to automatically scale up and manage these types of apps. I'd really like to see the APIs and development environment to better understand what can and can't be done with these two roles. I imagine some of the APIs are pretty neat.
  • .NET Services: hosts web services for use in your own apps and in other peoples' apps.
  • SQL Services: Azure's storage service, for now just a simple pseudo-relational database similar to Amazon SimpleDB. It will be interesting to see what else they add (data warehousing? something with fuller SQL?)
  • Live Services: Mostly seem to be a way to tap into Microsoft's Live web properties as well as its desktop mesh technology for connecting devices. This section of the paper was hard to extract useful information from since it was vague and somewhat full of marketing speak. The impression I got though is something like Facebook Connect or Facebook Apps, which lets apps interact with users' data within some structured environment. This is a pretty good idea even though it's not entirely clear right now how well Live will do.
In general, the advantages of Azure seem to be higher-level API (with a corresponding disadvantage of less developer freedom than EC2) and better integration with tools. I don't doubt that for certain key classes of apps, Microsoft's team has done serious user studies and planning to figure out how to let businesses use the cloud. The interesting question however will be whether Azure will have the same level of third-party developer energy going into it as the open-source-powered EC2. Projects like Hadoop for example are already supporting integration with EC2; it's very hard to imagine such projects running on Azure because they bring in dependencies on other open-source software (Java, Linux). Microsoft does have some great technology groups internally, but will those always be able to keep up with the experience and development effort of the open-source ecosystem?

Cloud Architectures / GrepTheWeb

This is a really interesting piece on how to build software for a cloud computing environment. The paper not only talks about a real example but extracts the nuggets for us so it's very easy to write about. They are:
- Make all pieces of the system scalable and, when needed, parallel.
- Make the pieces loosely coupled (their use of SQS is a great example).
- Launch things on demand (it's especially easy for their non-realtime query service but it's a good thing to aim for in all services).
- Be resilient to reboots and restarts (basically ROC).

All these ideas make sense. I think none of them is really novel, but it's great to see them combined together.

Beyond this, there are also some really useful tips about how to use SQS, S3, etc for maximal efficiency, which I imagine cloud users will find quite helpful.

Tuesday, February 24, 2009

PNUTS: Yahoo!’s Hosted Data Serving Platform

Problem: Scalable, available data storage for web applications.

Nugget: Provide a centrally managed storage system with support for relaxed consistency. Since we've read a few papers that do something similar (BigTable, Dynamo), the main differences in PNUTS seem to be a) support for multiple apps (important in a big organization like Yahoo) and b) geographic replication (important everywhere but not talked about in BigTable and Dynamo). The main implementation nugget seems to be use of a pub-sub message bus.

Why is it different from previous work? Mostly scale and geographic replication. Unlike BigTable and Dynamo, this is also more of a DB paper than a systems paper, so it talks about DB issues like how do you manage multiple apps using the system, how do you load data, etc.

Hard tradeoffs? CAP, as always.

Will it be influential in 10 years? Perhaps. It's a real system and it touches on some issues that data storage systems need to address (geographic replication for example). However, the actual design (including usage of YMB) may not stay the same.

Criticisms: I have two main criticisms. First, using a message bus is good from a software design point of view, but it moves complexity into the message bus. It would've been nice to have more design and evaluation of YMB. Second, the rate of 3000 requests/second for 384 tablet server machines is not too high. Why not add more clients to increase the workload, or make the clients use asynchronous requests?

Hive: Data Warehousing and Analytics on Hadoop

Problem: Mining event data generated by a large web application.

Nugget: Store data in a large distributed filesystem (HDFS) and query it with MapReduce (Hadoop). Provide an interface on top of this to let users express queries in SQL, create user-defined functions in Python, etc. Most importantly, manage metadata and schemas -- this is the primary difference between Hive and something like Pig.

Why is it different from previous work? This is a really interesting question given that the large-scale analytic DB space is pretty hot right now. The main reason given in the presentation is scale - Facebook expects the data warehouse to grow very large. They also mention that commercial products didn't have the appropriate availability, presumably due to not coping well with scale. However, perhaps one reason not covered is cost. From public pricing numbers, it seems that data warehouse DB products seem to cost from $100,000 per TB of user data for smaller databases down to $15,000 per TB of user data for very large ones (Teradata example). These prices may be discounted when you make an actual sale, but still, Hive is storing 200 TB of compressed data (and they seem to get 5x compression from the import numbers, so it might be 1 PB uncompressed), so this could cost tens of millions of dollars. At that price, building a cluster of 300 Hadoop machines and hiring ~10 programmers to build a data warehouse suddenly seems kind of attractive, even if the raw performance of Hadoop is not as good as that of an optimized DB engine. It will be interesting to see how this field plays out, as newer analytics DB startups (Greenplum, Aster Data, etc) are moving towards more shared-nothing, commodity-hardware systems.

Any hard tradeoffs? Certainly Hive had to sacrifice ACID and some amount of per-node performance in using Hadoop. On the performance side, it will be interesting to see how optimizations in Hive and Hadoop help (both systems have a lot of opportunity for optimization).

Will it be influential in 10 years? It's certainly influential today at Facebook. As more companies are starting to use Hadoop for data analysis (mostly of logs), they might use similar solutions (or even Hive itself, because Hive is open-source).

Wednesday, February 18, 2009

Dynamo, Amazon's Highly Available Key-Value Store

Problem: A large-scale data store that is efficient and reliable, for keeping up a large, highly available website. An especially interesting focus in this paper is the 99.9% SLA requirement - we haven't seen this in the Google papers for example (though they care about it too.)

Nuggets: Relax the consistency model. Design applications so that apps resolve conflicts, rather than trying to do it in the data store (for example, store mergeable "log entries" rather than absolute truth).

Why is it different from previous work? Scale, efficiency, and altering the problem a little (allowing some inconsistency if it can be resolved by the app).

Hard tradeoffs: Definitely a tradeoff between consistency/expressiveness of the data store and application complexity. We'd all like to write a shopping cart application such that the cart looks like a Ruby/Python/whatever object.. instead we have to worry about multiple keys, inconsistencies, etc.

Will it be influential? It's only spawned about 12 open-source look-alikes... The most interesting question is whether we'll have to trade application simplicity for scalability forever or we can find some abstractions that are "good enough" for e.g. the set of apps at Amazon.

Thursday, February 12, 2009

BigTable

Problem: Storing very large data sets in a structured format.

Nugget: Relax the relational model to provide a scalable yet flexible B-tree like store. Reuse as many "data center building blocks" as possible to make the system simple and robust (Chubby, GFS, SSTables, etc).

Why is it different from previous work? Mostly due to the scale.

Hard tradeoffs: There seems to be a tradeoff between ACID consistency + SQL query expressiveness and scalability. It's hard to say whether this is fundamental but it might be.

Will it be influential? Yes, there are about 12 open-source clones of it in various stages of completion. I think a more influential idea for me is the high amount of reuse of existing systems/libraries that went into the architecture, which made it possible to build a robust and efficient system and to focus on application-specific "hard stuff" as opposed to general distributed systems / storage systems "hard stuff".

Chubby

Problem: Providing consistency as a service to data center applications (locking, naming, etc).

Nugget: Centralized Paxos group with simple API used for coarse-grained master locks; masters then control locking within a data center application using whatever technique is appropriate.

Why is it different from previous work? This is an actual implementation of Paxos trying to address "social" problems with getting developers to use this kind of system and making it easy to use. It can also be viewed as designing an API for a locking service, and certainly the filesystem-like API is nice because it's very easy to use.

Tradeoffs: There is a tradeoff between high availability of the application Chubby is used for and modifying application code. Chubby actually manages to provide pretty good availability (and fast reaction times, etc) without too much application modification, but it's still not automatically available.

Will it be influential? Yes, as people write more data center apps they will run into this problem for the same reason Google did. This is also a small enough search space that Chubby might be close to the final solution we end up picking.

The Google File System

Problem: Storing very large data sets cost-efficiently in a way that allows computations to be run over them.

Nugget: Use a very large block size, replication, and simplified non-POSIX semantics to support scaling to large clusters of commodity machines.

Why is it different from previous work? Mostly due to a different problem scale, although GFS also makes some workload assumptions (mostly append or write-once). The other difference is in the use of commodity hardware (NOW-style) as opposed to really specialized hardware (as in supercomputers etc); this is driven by cost.

Hard tradeoffs: There's certainly a bit of a consistency vs performance/scalability tradeoff going on. Another tradeoff that appears in practice has to do with block size.. GFS is suboptimal for storing many small files because it needs metadata for each one.

Will it be influential? Yes, it's being used in several open source projects (Kosmos, HDFS) by other companies, and it seems like a good primitive for a data center to contain.

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.

Crash: Data Center Horror Stories

This article talks about two data center failures that were caused by faults in the power distribution equipment coupled with design mistakes. Although the article is only about hardware faults, it contains some interesting lessons that should be considered in designing both hardware and software.
  • First, anything can fail, even core infrastructure such as power-conducting equipment, and one undefended failure mode can bring down the entire system. One needs to ensure that there is no single point of failure in any aspect of the data center, not just obvious ones like machines or external power failing. One example story of a non-obvious "core component" failing in software is the EC2 outage earlier this year where a bit error induced in one machine led to erroneous information being propagated to all nodes in the system by the gossip protocol.
  • It is important to test failure cases to make sure the problem cannot escalate. In general, and in software in particular, it seems very hard to design systems that fail gracefully - software never checks for "reasonable" values on timeouts, status messages, etc, and one cannot isolate software components by physical distance like one can with hardware.
  • Finally, lesson three in the article - use datacenter-grade components only - may also be interesting to apply to software. Indeed, many data centers try to use either commercial software or proven open-source software. As researchers interested in data centers, however, we need to keep in mind how we plan to ensure that our work is datacenter-grade if we build new things. Again, I think this points to the importance of testing. It's shocking how little time is spent in systems, DB, etc courses on software testing, when testing is the main process through which bugs are kept in control in a production environment.

Friday, January 30, 2009

Now Featuring Clouds!

This blog is now repurposed to hold reading summaries for Ion Stoica's course on cloud computing.