CASSANDRA -A Decentralized Structured Storage S ystem

Post on 24-Feb-2016

46 views 0 download

Tags:

description

CASSANDRA -A Decentralized Structured Storage S ystem. Presented By Sadhana Kuthuru. OVERVIEW :. Introduction Data Model API System architecture Facebook Inbox Search Conclusion. GOOD QUOTE!. - PowerPoint PPT Presentation

Transcript of CASSANDRA -A Decentralized Structured Storage S ystem

CASSANDRA-A Decentralized Structured Storage System

Presented BySadhana Kuthuru

OVERVIEW:• Introduction• Data Model• API• System architecture• Facebook Inbox Search• Conclusion

GOOD QUOTE!

Google,Amazon,Facebook and DARPA all recognized that when you scale system large enough, you can never put enough iron in one place to get the job done(and you wouldn’t want to, to prevent a single point of failure)once you accept that you have a distributed system, you need to give up consistency or availability ,which the fundamental transactionality of traditional RDMS cannot abide.

-Cedric Beust

Why NoSQL(features):

It provides:• Horizontal scalability• Open-source• Schema-freeness• Easy replication support• Simple API

CAP(for NoSQL)

NEED FOR CASSANDRA BY FACE BOOK:

• Scalability• Availability• Replication• Fault Tolerance• Eventual consistency• Read/write performance• Flexible schema

DATAMODEL:

• Table is a multi dimensional indexed by a row key.• Operation under single indexed row key is atomic per replica.• Columns are grouped into two kinds of column families: - Simple column family - Super column family(column family within a column

family)• Each column has - Name - Value -Time stamp

DATA MODEL :

*Figure taken from Eben Hewitt’s (author of Oreilly’s Cassandra book) slides.

CASSANDRA API:

The Cassandra API consists of following three methods:• insert(table; key; rowMutation)• get(table; key; columnName)• delete(table; key; columnName)

SYSTEM ARCHITECTURE:

PARTITIONING• The ability to dynamically partition the data over the set of

nodes in the cluster.• Uses an order preserving hash function.• Load balancing-lightly loaded nodes move position to

alleviate highly loaded nodes.

PARTITIONING:

REPLICATION:

• How data is duplicated across nodes.• Uses replication to achieve high availability and durability.• Different Replication Policies -Rack Unaware -Rack Aware -Datacenter Aware.

FAILURE DETECTION:

• A mechanism by which a node can locally determine if any other node in a system is up or down.

• Failure detection is given by accrual failure detector Ф.• If a node is faulty the suspicion level automatically increases with time Ф(t)→k as t →k where k is threshold variable(depends on system

load)which means node is dead.

FAILURE DETECTION:

• If a node is correct Ф will be constant set by application. Generally

Ф(t)=0

BOOTSTRAPPING:

• Two ways to add new node - new node gets assigned a random token which gives its

position in the ring. It gossips its location to the rest of the ring.

- new node reads its configuration files to contact the initial contact points

• An administrator uses command line or browser to initiate the addition and removal of nodes from Cassandra instance

SCALING THE CLUSTER:

• Lightly loaded nodes can move to alleviate heavily loaded nodes.

• The Cassandra bootstrap algorithm is initiated.

FACEBOOK INBOX SEARCH:

• Cassandra was designed to fulfill the storage needs of Inbox search problem.

• Unable users to search through their face book inbox.• Two kinds of search features: -Term search: search by a keyword -Interactions search: search by a user id.

FACEBOOK INBOX SEARCH:

• To make searches fast ,it provides buffer caching of data .• Currently stores 50+ TB of data on a 150 node cluster.

Latency Stat Search Interactions Term Search

Min 7.69 ms 7.78 ms

Median 15.69ms 18.27 ms

Max 26.13 ms 44.41 ms

APACHE CASSANDRA:

• After face book open sourced the code Facebook Cassandra of 2008 became Apache Cassandra in 2010.

• Some of the Cassandra deployments include: - Netflix,Twitter,Abode - HP,IBM,Cisco - Digg,Rackspace,Reditt.

CONCLUSION:

Cassandra meets Facebook storage requirements:• Incremental growth .• Regular check of component failure.• Data optimization from special operations.• Simple architecture.• Fault Tolerance.

THANK YOU AND ANY QUESTIONS?