Faster websites, more reliable data
October 14, 2010 Larry Hardesty, MIT News
Today, visiting almost any major website -- checking your Facebook news feed, looking for books on Amazon, bidding for merchandise on eBay -- involves querying a database. But the databases that these sites maintain are enormous, and searching them anew every time a new user logs on would be painfully time consuming. To serve up data in a timely fashion, most big sites use a technique called caching. Their servers keep local copies of their most frequently accessed data, which they can send to users without searching the database.
But caching has an obvious problem: If any of the data in the database changes, the cached copies have to change too; moreover, any cached data that are in any way dependent on the changed data also have to change. Tracking such data dependencies is a nightmare for programmers, but even when they do their jobs well, problems can arise. For instance, says Dan Ports, a graduate student in the Computer Science and Artificial Intelligence Lab, suppose that someone is bidding on an item on eBay. The names of the bidders could be cached in one place, the value of their bids in another. Making a new bid updates the database, but as that update propagates through the network of servers, it could reach the value cache before it reaches the name cache. The bidder would see someone elses name next to her bid and think shed been beaten to the punch. They might see their own bid attributed to somebody else, Ports says, and wind up in a bidding war with themselves.
MIT researchers have developed a new caching system that eliminates this type of asymmetric data retrieval while also making database caches much easier to program. Led by Ports and his thesis advisor, Institute Professor Barbara Liskov, who won the 2008 Turing Award, the highest award in computer science, the research also involves associate professor Sam Madden, PhD student Austin Clements, and former masters student Irene Zhang. Ports presented the system on Oct. 5 at the USENIX Symposium on Operating Systems Design and Implementation in Vancouver.
Transact locally
Unlike existing database caching systems, Ports and Liskovs can handle what computer scientists call transactions. A transaction is a set of computations that are treated as a block: None of them will be performed unless all of them are performed. Suppose that youre making a plane reservation, and it has two legs, says Liskov. Youre not interested in getting one of them and not the other. If you run this as a transaction, then the underlying system will guarantee that you get either both of them or neither of them. And it does this regardless of whether there are other concurrent accesses, or other users are trying to get seats on those flights, or there are machine failures, and so forth. Transactions are a well-understood technique in computer science to achieve this kind of functionality. Indeed, its the idea of transactions that gives the new system its name: TxCache, where Tx is a shorthand for transaction.
TxCache also makes it easier for programmers to manage caches. Existing caches have the approach that they just make this cache and tell the programmer, Heres a cache: You can put stuff in it if you want; you can get stuff out of it if you want, says Ports. But figuring out how to do that is entirely up to you. TxCache, however, recognizes that a computer program already implicitly defines the relationships between stored data. For instance, a line of code might say that Z = X + Y, which is an instruction to look up X, look up Y, and store their sum as Z. With TxCache, the programmer would simply specify that that line of code Z = X + Y should be cached, and the system would automatically ensure that, whenever any one of those variables changed, the cached copies of the other two would be updated, everywhere. And, of course, it can perform the same type of maintenance with more complicated data dependencies, represented by more complicated functions.
Bean counting
According to Liskov, the key to getting TxCache to work was a lot of bookkeeping. The system has to track what data are cached where, and which data depend on each other. Indeed, Liskov says, it was the fear that that bookkeeping would chew up too many computing cycles that dissuaded the designers of existing caching systems from supporting transactions. But, she explains, updating the caches is necessary only when data in the database change. Modifying the data is a labor-intensive operation; the bookkeeping steps are comparatively simple. Yes, we are doing more work, but proportionally its very small, Liskov says. Its on the order of 5 to 7 percent. In the researchers experiments, websites were more than five times as fast when running TxCache as they were without it.
The trouble with large-scale services like Bing and Amazon and Google and the like is that they operate at such a high level of scalability, says Solom Heddaya, a partner at Microsoft and infrastructure architect for Bing, Microsofts search engine. On a single request from the user searching for something, there are many, many applications that get invoked in real time, and they together will use tens of thousands of servers. On that scale, Heddaya says, some kind of caching system is necessary. But, he says, until this paper came along, people building these systems said, Hey, we will shift the burden to the programmer of the application. We will give you the convenience of caching, so that we bring the data closer to where the computation is, but we will make you worry about whether the cache has the right data.
Heddaya cautions that, unlike some other caching systems, the MIT researchers offers significant performance improvements only for sites where reading operations looking up data in the database greatly outnumber writing operations updating data in the databases. But according to Ports, Adding support for using caching during read/write transactions is one of the things we're thinking about now. There aren't any major technical obstacles to doing so: It's mainly a question of how we can do so without introducing unexpected effects that make life more difficult for users and programmers.
This story is republished courtesy of MIT News (http://web.mit.edu/newsoffice/), a popular site that covers news about MIT research, innovation and teaching.
Provided by
Massachusetts Institute of Technology
-
From lemons to lemonade: Reaction uses carbon dioxide to make carbon-based semiconductor,
28 comments
-
Every black hole contains a new universe: A physicist presents a solution to present-day cosmic mysteries,
212 comments
-
New silicon memory chip developed,
16 comments
-
Computing experts unveil superefficient 'inexact' chip,
45 comments
-
SpaceX private rocket blasts off for space station (Update),
41 comments
-
Live scribe pen?
May 10, 2012
-
Shallow water flow simulation
May 07, 2012
-
Tablet for taking notes?
May 05, 2012
-
Best fit tablet for me?
May 05, 2012
-
Measure of Informaton
May 04, 2012
-
Cost in a software project
May 03, 2012
- More from Physics Forums - Computing & Technology
More news stories
HyperSolar shows dirty water no barrier to power world
(Phys.org) -- The Santa Barbara, California, company, HyperSolar, is set to transparently share the ups and downs of its research experiences toward the companys ultimate vision, successfully producing ...
Google reveals copyrighted material claims (Update)
Google on Thursday began revealing details about requests for links to be removed from Internet search results on the grounds they lead to copyrighted material posted without permission.
52 minutes ago |
not rated yet |
0
Nasdaq caused $35 mn loss in Facebook IPO: broker
A New York broker has asked Nasdaq to compensate it for up to $35 million in losses on the Facebook initial public offering due to the market's computer problems on the first day of trade.
44 minutes ago |
not rated yet |
0
Airbus offers US airlines fat profits from obese seats
Airbus is offering US airlines buying its A320 passenger jet extra-wide seats for obese passengers, leading to fatter profits, Airbus' aircraft interiors director said Thursday.
42 minutes ago |
not rated yet |
0
S. Korea, Peru announce defense technology deal
South Korea's Foreign Minister Kim Sung-hwan agreed Thursday to grant technology transfers to Peru to help strengthen the Latin American nation's navy and air force.
42 minutes ago |
not rated yet |
0
'Metamaterials,' quantum dots show promise for new technologies
(Phys.org) -- Researchers are edging toward the creation of new optical technologies using "nanostructured metamaterials" capable of ultra-efficient transmission of light, with potential applications including ...
Global warming winner: Once rare butterfly thrives
(AP) -- Global warming is rescuing the once-rare brown Argus butterfly, scientists say.
NASA satellites feed forecasters information as Bud becomes a hurricane
Bud has now become the first hurricane of the eastern Pacific Hurricane Season, as NASA visible and infrared satellite imagery revealed an organized structure of spiraling thunderstorms around the eye. Watches ...
Cyber exercise partners help you go the distance: Motivation gains can double
A new study testing the benefits of a virtual exercise partner shows the presence of a moderately more capable cycling partner can significantly boost the motivation by as much as 100 percent ...
Childhood cancer scars survivors later in life
Scars left behind by childhood cancer treatments are more than skin-deep. The increased risk of disfigurement and persistent hair loss caused by childhood cancer and treatment are associated with emotional distress and reduced ...
Low vitamin D in diet increases stroke risk in Japanese-Americans
Japanese-American men who did not eat foods rich in vitamin D had a higher risk of stroke later in life, according to results of a 34-year study reported in Stroke, an American Heart Association journal.