Twitter growth prompts switch from MySQL to 'NoSQL' database

Hopes open source technology can further boost improving Twitter uptime record

Ryan King, an engineer at Twitter, today told the blog MyNoSQL that the social networking company plans to move from MySQL to the Cassandra database for what he called its resilience, scalability and large community of open-source developers.

"We have a lot of data, the growth factor in that data is huge and the rate of growth is accelerating," King said in the interview posted on MyNoSQL.

San Francisco-based Twitter currently uses a cluster of MySQL servers with a memcached caching system that "is quickly becoming prohibitively costly (in terms of manpower) to operate. We need a system that can grow in a more automated fashion and be highly available," King told MyNoSQL.

The number of daily tweets has grown more than twenty-fold in the past year, from about two million a day in January, 2009 to nearly 50 million a day last month.

That growth has caused pain, and some devoted users complain loudly whenever Twitter crashes and the so-called 'fail whale' appears.

Twitter has nevertheless improved its uptime significantly in the last 12 months. The site was up 99.72% (down 23 hours, 45 minutes) in the last 12 months, according to Web monitoring firm, Pingdom. In 2008, according to Pingdom, Twitter was down for 84 hours, worst of 15 major social networking sites.

Twitter hopes that deploying the Apache Software Foundation's Cassandra database will improve that record further.

First developed by Facebook to augment its MySQL installation, Cassandra is a lean Java-based data store, that shucks the overhead of conventional relational databases. The technology is similar to that offered in other emerging NoSQL databases like MapReduce and Hadoop,

For skilled programmers, the so-called NoSQL databases can boost performance and scalability, which has made them attractive to the consumer Web world.

Like Facebook and Twitter, Digg is also moving from MySQL , the initial Web 2.0 darling, to Cassandra.

Cisco Systems Inc., hosting provider Rackspace and other firms also use Cassandra. The largest Cassandra instance in production runs 100TB of data using 150 servers, according to the project's web site.

The interview was cited in a tweet from King, who has 297,334 Twitter followers.

In the blog intervirew, King said that Twitter looked at a number of options for upgrading its system, including re-architecting MySQL so that it runs better in a cluster (called 'sharding'), and the offerings of several Cassandra NoSQL rivals such as HBase, Voldemort, MongoDB, MemCacheDB, Redis and HyperTable.

King said that test found that Cassandra was more scalable, reliable and easier to manage than the alternatives.

Twitter is "currently moving our largest (and most painful to maintain) table -- the statuses table, which contains all tweets and retweets" to Cassandra, he said. "After this we'll start putting some new projects on Cassandra and migrating other tables."

To minimize downtime during the migration, Twitter plans to implement new features by running them in Cassandra alongside MySQL in case any bugs crop up. Once its determined there are no bugs, Twitter will back up MySQL data and then export it to Cassandra in a process that would take about a week, he said.

Only after more testing, will it turn Cassandra on for production and shut down MySQL.

"Our process for rolling out new major infrastructure can be summed up as 'integrate first, then iterate,' King said.

Eric Lai covers Windows and Linux, desktop applications, databases and business intelligence for Computerworld . Follow Eric on Twitter at @ericylai or send e-mail to elai@computerworld.com.

Read more about databases in Computerworld's Databases Knowledge Center.

Join the Good Gear Guide newsletter!

Error: Please check your email address.

Tags databasesmysqltwitter

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Eric Lai

Computerworld (US)
Show Comments

Essentials

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Budget

Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Kathy Cassidy

STYLISTIC Q702

First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni

STYLISTIC Q572

For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?