Cassandra (database)
Encyclopedia
Apache Cassandra is an open source  distributed database management system
Database management system
A database management system is a software package with computer programs that control the creation, maintenance, and use of a database. It allows organizations to conveniently develop databases for various applications by database administrators and other specialists. A database is an integrated...

. It is an Apache Software Foundation
Apache Software Foundation
The Apache Software Foundation is a non-profit corporation to support Apache software projects, including the Apache HTTP Server. The ASF was formed from the Apache Group and incorporated in Delaware, U.S., in June 1999.The Apache Software Foundation is a decentralized community of developers...

 top-level project designed to handle very large amounts of data spread out across many commodity servers while providing a highly available service with no single point of failure
Single point of failure
A single point of failure is a part of a system that, if it fails, will stop the entire system from working. They are undesirable in any system with a goal of high availability or reliability, be it a business practice, software application, or other industrial system.-Overview:Systems can be made...

. It is a NoSQL solution that was initially developed by Facebook
Facebook
Facebook is a social networking service and website launched in February 2004, operated and privately owned by Facebook, Inc. , Facebook has more than 800 million active users. Users must register before using the site, after which they may create a personal profile, add other users as...

 and powered their Inbox Search feature until late 2010. Jeff Hammerbacher, who led the Facebook Data team at the time, has described Cassandra as a BigTable
BigTable
BigTable is a compressed, high performance, and proprietary database system built on Google File System , Chubby Lock Service, SSTable and a few other Google technologies; it is currently not distributed nor is it used outside of Google, although Google offers access to it as part of their Google...

 data model running on an Amazon Dynamo
Dynamo (storage system)
Dynamo is a highly available, proprietary key-value structured storage system or a distributed data store. It has properties of both databases and distributed hash tables...

-like infrastructure.

Cassandra provides a structured key-value store with tunable consistency. Keys map to multiple values, which are grouped into column families. The column families are fixed when a Cassandra database is created, but columns can be added to a family at any time. Furthermore, columns are added only to specified keys, so different keys can have different numbers of columns in any given family.

The values from a column family for each key are stored together. This makes Cassandra a hybrid data management system between a column-oriented DBMS
Column-oriented DBMS
A column-oriented DBMS is a database management system that stores its content by column rather than by row. This has advantages for data warehouses and library catalogues where aggregates are computed over large numbers of similar data items....

 and a row-oriented store. Also, besides using the way of modeling of BigTable, it has properties like eventual consistency
Eventual consistency
Eventual consistency is one of the consistency models used in the domain of parallel programming, for example in distributed shared memory, distributed transactions, and optimistic replication, it means that given a sufficiently long period of time over which no changes are sent, all updates can be...

, the Gossip protocol
Gossip protocol
A gossip protocol is a style of computer-to-computer communication protocol inspired by the form of gossip seen in social networks. Modern distributed systems often use gossip protocols to solve problems that might be difficult to solve in other ways, either because the underlying network has an...

, a master-master way of serving the read and write requests that are inspired by Amazon's Dynamo
Dynamo (storage system)
Dynamo is a highly available, proprietary key-value structured storage system or a distributed data store. It has properties of both databases and distributed hash tables...

.

History

Apache Cassandra was developed at Facebook to power their Inbox Search feature by Avinash Lakshman (one of the authors of Amazon's Dynamo) and Prashant Malik. It was released as an open source project on Google code
Google Code
Google Code is Google's site for developer tools, APIs and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers using Google's developer products....

 in July 2008. In March 2009, it became an Apache Incubator
Apache Incubator
Apache Incubator is the gateway for Open source projects intended to become fully fledged Apache Software Foundation projects.The Incubator project was created in October 2002 to provide an entry path to the Apache Software Foundation for projects and codebases wishing to become part of the...

 project. On February 17, 2010 it graduated to a top-level project.

Data model

A table in Cassandra is a distributed multidimensional map indexed by a key. The value is an object that is highly structured. The row key in a table is a string with no size restrictions, although typically 16 to 36 bytes long. Every operation under a single row key is atomic per replica no
matter how many columns are being read or written into. Columns are grouped together into sets called column families very much similar to what happens in the BigTable
BigTable
BigTable is a compressed, high performance, and proprietary database system built on Google File System , Chubby Lock Service, SSTable and a few other Google technologies; it is currently not distributed nor is it used outside of Google, although Google offers access to it as part of their Google...

 system. Cassandra exposes two kinds of column families: Simple and Super. Super column families can be visualized as a column family within a column family. The top dimension in Cassandra is called Keyspace.

Therefore, Cassandra can handle maps with four or five dimensions:

Map with four dimensions:
  1. Keyspace → Column Family
  2. Column Family → Column Family Row
  3. Column Family Row → Columns
  4. Column → Data value


Map with five dimensions:
  1. Keyspace → Super Column Family
  2. Super Column Family → Super Column Family Row
  3. Super Column Family Row → Super Columns
  4. Super Column → Columns
  5. Column → Data value


The first dimension - Keyspace → (Super) Column Family - is limited to a (small) set of schema-predefined keys. Cassandra documentation mentions similarities of this dimension with the table definition inside a relational database.

Furthermore, applications can specify the sort order of columns within a Super Column or Simple Column family. The system allows columns to be sorted either by time or by name. Time sorting of columns is exploited by applications like Facebook Inbox Search, where the results are always displayed in time-sorted order. Any column within a column family is accessed using the convention column_family : column, and any column within a column family that is of type super is accessed using the convention column_family : super_column : column.

Clustering

When the cluster for Apache Cassandra is designed, an important point is to select the right partitioner. Two partitioners exist:
  1. RandomPartitioner (RP): This partitioner randomly distributes the key-value pairs over the network, resulting in a good load balancing. Compared to OPP, more nodes have to be accessed to get a number of keys.
  2. OrderPreservingPartitioner (OPP): This partitioner distributes the key-value pairs in a natural way so that similar keys are not far away. The advantage is that fewer nodes have to be accessed. The drawback is the uneven distribution of the key-value pairs.

Decentralized

Every node in the cluster has the same role. There is no single point of failure. Data is distributed across the cluster (so each node contains different data), but there is no master as every node can service any request.

Elasticity

Read and write throughput both increase linearly as new machines are added, with no downtime or interruption to applications.

Fault-tolerant

Data is automatically replicated to multiple nodes for fault-tolerance. Replication
Replication (computer science)
Replication is the process of sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault-tolerance, or accessibility. It could be data replication if the same data is stored on multiple storage devices, or...

 across multiple data centers is supported. Failed nodes can be replaced with no downtime.

Tunable consistency

Writes and reads offer a tunable level of consistency, all the way from "writes never fail" to "block for all replicas to be readable", with the quorum level in the middle.

Prominent users

  • AppScale
    AppScale
    AppScale is an open-source framework for running Google App Engine applications. It is an implementation of a cloud computing platform , supporting Xen, KVM, Amazon EC2 and Eucalyptus. It has been developed and is maintained by the RACELab at UC Santa Barbara.AppScale allows users to upload...

     uses Cassandra as a back-end for Google App Engine applications
  • Cisco
    Cisco
    Cisco may refer to:Companies:*Cisco Systems, a computer networking company* Certis CISCO, corporatised entity of the former Commercial and Industrial Security Corporation in Singapore...

    's WebEx
    WebEx
    WebEx Communications Inc. is a Cisco company that provides on-demand collaboration, online meeting, web conferencing and videoconferencing applications...

     uses Cassandra to store user feed and activity in near real time.
  • Clearspring uses Cassandra "[keep] track of how many times a URL is shared and serves over 200M view requests daily."
  • Cloudkick
    Cloudkick
    Cloudkick is a cloud server management and monitoring SaaS based out of San Francisco. Cloudkick's products include a centralized server monitoring tool for multiple cloud server providers, as well as dynamic server management tools...

     uses Cassandra to store the server metrics of their users.
  • Cloudtalk's Platform contains API's for users to create messaging apps with Cassandra as it's data store.
  • Constant Contact
    Constant Contact
    Constant Contact, Inc. , launched in 1998, is an online marketing company serving small businesses, nonprofit organizations, and membership associations. The company offers email marketing, social media marketing, online survey, and event marketing tools....

     uses Cassandra in their social media marketing application.
  • Digg
    Digg
    Digg is a social news website. Prior to Digg v4, its cornerstone function consisted of letting people vote stories up or down, called digging and burying, respectively. Digg's popularity prompted the creation of copycat social networking sites with story submission and voting systems...

    , a large social news website, announced on Sep 9th, 2009 that it is rolling out its use of Cassandra and confirmed this on March 8, 2010. TechCrunch
    TechCrunch
    TechCrunch is a web publication that offers technology news and analysis, as well as profiling of startup companies, products, and websites. It was founded by Michael Arrington in 2005, and was first published on June 11, 2005....

     has since linked Cassandra to Digg v4 reliability criticisms and recent company struggles. Lead engineers at Digg later rebuked these criticisms as red herring and blamed a lack of load testing.
  • Digital Reasoning's Synthesys application with potential scale to over a 400-node Cassandra database was rolled out in late 2010.
  • Facebook
    Facebook
    Facebook is a social networking service and website launched in February 2004, operated and privately owned by Facebook, Inc. , Facebook has more than 800 million active users. Users must register before using the site, after which they may create a personal profile, add other users as...

     used Cassandra to power Inbox Search, with over 200 nodes deployed. This was abandoned in late 2010 when they built Facebook Messaging platform on HBase
    HBase
    HBase is an open source, non-relational, distributed database modeled after Google's BigTable and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS , providing BigTable-like capabilities for Hadoop...

    .
  • IBM
    IBM
    International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

     has done research in building a scalable email system based on Cassandra.
  • Isidorey is the creator of Cloudsandra: a multi-tenant platform built on Brisk (Hadoop + Cassandra).
  • Martini Media Network moved from MySQL to Cassandra.
  • Mollom uses Cassandra to track reputations from IP data
  • Netflix
    Netflix
    Netflix, Inc., is an American provider of on-demand internet streaming media in the United States, Canada, and Latin America and flat rate DVD-by-mail in the United States. The company was established in 1997 and is headquartered in Los Gatos, California...

     uses Cassandra as their back-end database for their streaming services
  • Formspring uses Cassandra to count responses, as well as store Social Graph data (followers, following, blockers, blocking) for 26 Million accounts with 10 million responses a day
  • Mahalo.com
    Mahalo.com
    Mahalo.com is a web directory and Internet-based knowledge exchange launched in alpha test in May 2007 by Jason Calacanis...

     uses Cassandra to record user activity logs and topics for their Q&A website
  • Ooyala
    Ooyala
    Ooyala is a venture-backed, privately held company that provides online video technology products and services. The company was founded in 2007 by brothers Bismarck Lepe and Belsasar Lepe, and their colleague and friend from Google, Sean Knapp...

     Built a scalable, flexible, real-time analytics engine using Cassandra
  • At Openwave
    Openwave
    Openwave is a software company. Based in Redwood City, California, USA, Openwave is historically significant in its introduction of the Mobile Internet and its expansion into a large successful mobile software supplier in the mobile telecom sector...

    , Cassandra acts as a distributed database and serves as a distributed storage mechanism for Openwave’s next generation messaging platform
  • OpenX
    OpenX
    OpenX refers to:* OpenX - a company based in Pasadena, California* OpenX - an open-source software package...

     is running over 130 nodes on Cassandra for their OpenX Enterprise product to store and replicate advertisements and targeting data for ad delivery
  • Plaxo
    Plaxo
    Plaxo is an online address book and social networking service originally founded by Sean Parker, Minh Nguyen and two Stanford engineering students, Todd Masonis and Cameron Ring...

     has "reviewed 3 billion contacts in [their] database, compared them with publicly available data sources, and identified approximately 600 million unique people with contact info."
  • PostRank uses Cassandra as their backend database
  • Rackspace
    Rackspace
    Rackspace US, Inc. is an IT hosting company based in San Antonio, Texas. The company also has offices in Australia, the United Kingdom, The Netherlands and Hong Kong, and data centers operating in Texas, Illinois, Virginia, the United Kingdom, and Hong Kong in late 2008...

     is known to use Cassandra internally.
  • Reddit
    Reddit
    reddit is a social news website where the registered users submit content, in the form of either a link or a text "self" post. Other users then vote the submission "up" or "down," which is used to rank the post and determine its position on the site's pages and front page.Reddit was originally...

     switched to Cassandra from memcacheDB
    Memcachedb
    MemcacheDB is a persistence enabled variant of memcached, a general-purpose distributed memory caching system often used to speed up dynamic database-driven websites by caching data and objects in memory...

     on March 12, 2010 and experienced some problems with overload handling in Cassandra in May.
  • RockYou
    RockYou
    RockYou is a developer of social games and advertising solutions for social media. RockYou is focused on the development of social game titles, including Gourmet Ranch and the Zoo World franchise...

     uses Cassandra to record every single click for 50 million Monthly Active Users in real-time for their online games
  • ShopSavvy uses Cassandra as their storage technology for their barcode scanning application
  • SimpleGeo built a scalable geospatial database on top of Apache Cassandra
  • SoundCloud
    SoundCloud
    SoundCloud is an online audio distribution platform which allows collaboration, promotion and distribution of audio recordings.-History:SoundCloud was originally started in Stockholm, Sweden, but was established in Berlin, Germany in August, 2007 by sound designer Alex Ljung and artist Eric Wahlforss...

     uses Cassandra to store user account information
  • Twitter
    Twitter
    Twitter is an online social networking and microblogging service that enables its users to send and read text-based posts of up to 140 characters, informally known as "tweets".Twitter was created in March 2006 by Jack Dorsey and launched that July...

     announced it is planning to use Cassandra because it can be run on large server clusters and is capable of taking in very large amounts of data at a time. Twitter continues to use it but not for Tweets themselves.
  • Urban Airship
    Urban Airship
    Urban Airship is a privately held technology company based in Portland, Oregon. The company offers products related to mobile push technology and mobile in-app purchases/subscriptions.-History:In 2009 the Urban Airship was founded by current CEO Scott Kveton...

     uses Cassandra with the mobile service hosting for over 160 million application installs across 80 million unique devices
  • Utillabs uses Cassandra for its Low Voltage Smart System for fine grained event / reading recording and analytics
  • Walmart Labs (previously Kosmix
    Kosmix
    Kosmix was an American privately held company in Mountain View, California. Their website earned revenue from advertising related to its categorization engine. The engine organizes the Internet into topic pages allowing users to explore the Web by topic, "presenting a dashboard of relevant videos,...

    ) uses Cassandra with SSD
  • Yakaz
    Yakaz
    Yakaz is an online platform for local classifieds and discussions. Available worldwide, the site focuses on online interactions between neighbors...

     uses Cassandra on a five-node cluster to store millions of images as well as its social data.

See also

  • BigTable
    BigTable
    BigTable is a compressed, high performance, and proprietary database system built on Google File System , Chubby Lock Service, SSTable and a few other Google technologies; it is currently not distributed nor is it used outside of Google, although Google offers access to it as part of their Google...

     - Original distributed database by Google
  • Distributed database
  • Distributed hash table
    Distributed hash table
    A distributed hash table is a class of a decentralized distributed system that provides a lookup service similar to a hash table; pairs are stored in a DHT, and any participating node can efficiently retrieve the value associated with a given key...

     (DHT)
  • Dynamo (storage system)
    Dynamo (storage system)
    Dynamo is a highly available, proprietary key-value structured storage system or a distributed data store. It has properties of both databases and distributed hash tables...

     - Cassandra borrows many elements from Dynamo
  • Apache HBase
    HBase
    HBase is an open source, non-relational, distributed database modeled after Google's BigTable and is written in Java. It is developed as part of Apache Software Foundation's Apache Hadoop project and runs on top of HDFS , providing BigTable-like capabilities for Hadoop...

     - Apache Hadoop
    Hadoop
    Apache Hadoop is a software framework that supports data-intensive distributed applications under a free license. It enables applications to work with thousands of nodes and petabytes of data...

     based distributed database. Very similar to BigTable
  • Hypertable
    Hypertable
    Hypertable is an open source database inspired by publications on the design of Google's BigTable. The project is based on experience of engineers who were solving large-scale data-intensive tasks for many years....

     - Apache Hadoop
    Hadoop
    Apache Hadoop is a software framework that supports data-intensive distributed applications under a free license. It enables applications to work with thousands of nodes and petabytes of data...

     based distributed database. Very similar to BigTable
  • Riak
    Riak
    Riak is a NoSQL database implementing the principles from Amazon's Dynamo paper.Riak has a pluggable backend for its core shard-partitioned storage, with the default storage backend being Bitcask as of the 0.12 release...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK