2 Comments

Summary:

To serve up data quickly inside its Neighborhoods feature, Airbnb engineers cycled through a few database choices before choosing Memcached.

Airbnb neighborhoods feature
photo: Airbnb screen shot

One of Airbnb’s neat features, Neighborhoods, shows people elegant pages on neighborhoods within big cities that can help them choose exactly where to stay. Actual homes where visitors can stay the night are directly tied to the neighborhood pages. The idea sounds obvious, but it took some engineering tinkering to figure out how to make it all work accurately and quickly.

On the Airbnb Nerd Blog on Thursday, engineers Andy Kramolisch and Ben Hughes, who worked on Neighborhoods and previously founded NabeWise, a neighborhood guide for American cities, explained the back-end process of aligning locations with neighborhoods.

Behind the scenes, Kramolisch said, a cartographer carves out the borders of neighborhoods. Then it’s time to match up hosts’ homes with the neighborhoods listed on Airbnb. On the site’s back end, Kramolisch said, the latitude and longitude of available homes are regularly associated with the various neighborhoods in a given city, if those neighborhoods are represented on Airbnb, through an internal system called Glop, short for Genome Location Pipeline. “For example, say you list your place, which is located at (12.333568650219718, 45.43647998034738). The next time Glop runs, it will correctly identify your listing as being in San Marco,” he said.

It’s not as if Neighborhoods works with “insane amounts of data,” Kramolisch said. Still, up-to-date data on places to stay in neighborhoods needs to be served up quickly, so users aren’t kept waiting in front of their screens. Data changes fast, and an SQL database wouldn’t work because of “mass updates,” Kramolisch said. So an internal NoSQL database in cooperation with Amazon Web Services’ managed DynamoDB NoSQL database service was considered. But DynamoDB couldn’t handle Airbnb’s storage needs. So the engineers turned to the Memcached key-value store for quickly serving up data by keeping it in memory.

In going with Memcached, Airbnb is making the same choice as Facebook, Etsy and other companies that operate at webscale. Location is the top criterion for Airbnb travelers, Kramolisch says, and the fast service Memcached enables — 35 milliseconds on average, to be precise — is the kind of solution that could help Airbnb focus on giving customers more of what they want from the site, when they want it.

You’re subscribed! If you like, you can update your settings

  1. 1. DynamoDB is a NOSQL database.
    2. Memcached is not a database. http://code.google.com/p/memcached/wiki/NewProgrammingFAQ#Why_can%27t_I_use_it_as_a_database?

    Fixed headline: Airbnb chooses tried and true SQL + memcached over DyanmoDB

  2. They could easily choose Redis. Better data types.

Comments have been disabled for this post