cassandra tech talk

15
CASSANDRA UDA SE Tech Talk Sep 20 2012

Upload: satish-mehta

Post on 15-Jan-2015

280 views

Category:

Technology


4 download

DESCRIPTION

Cassandra Tech Talk that I gave for UDA SE and DBA teams on Sep 20 2012. The preso was followed by a demo.

TRANSCRIPT

Page 1: Cassandra tech talk

CASSANDRA

UDA SE Tech TalkSep 20 2012

Page 2: Cassandra tech talk

2

Agenda•What is Cassandra?•Architecture•Why use Cassandra?•Current Consumers/use cases?•Limitations•Demo

Page 3: Cassandra tech talk

3

CASSANDRA

Page 4: Cassandra tech talk

4

What is Cassandra?

-Free, Open Source, Distributed database-Written by 2 Facebook Engineers-Hybrid of

- BigTable from Google- DynamoDB from Amazon

-For Structured, Semi-structured, Unstructured Data-Designed to scale across commodity servers-Assures AP out of CAP

- (Consistency, Availability, Partition Tolerance)

Page 5: Cassandra tech talk

5

Architectural Overview•Independent nodes form cluster

•All nodes peers

•Gossip protocol to discover/connect nodes

•Gossip process runs every second

•Nodes exchanges state mesgs with max 3 nodes

•Nodes exchange info about themselves/Others

•Seed Nodes have cluster info in cassandra.yaml file

•All nodes have same seed nodes in their config file

•Nodes remember all gossip info since last restart

Page 6: Cassandra tech talk

Data Partitioning

6

•Should be decided when setting up•Total Data managed by Cassandra like a Ring•Ring is divided into Ranges•Each node responsible for one or more•Before a node joins it is given a token•Token depends on• Node’s position• Range of data it is responsible for

•Column Family partitioned based on row key•For given row key value, ring is walked clockwiseuntil token is within range•2 High Level Partitioning Schemes:

- Random Partitioner- Ordered Partitioner

•Random Partitioner uses consistent hashing •Ordered Partitioner ensures sorted order.

Page 7: Cassandra tech talk

Data Partitioning (Contd)

7

Partitioning in Multi-Data Center Clusters

Page 8: Cassandra tech talk

Replication

8

•Replication – process of storing copies of data

•Replication Strategy

• Number of Replicas

• Distro of replicas over the nodes

•Relies on cluster configured Snitch

•SimpleStrategy - default

•NetworkTopologyStrategy

•Takes rack, data center into consideration

Page 9: Cassandra tech talk

Snitches…

9

•The snitch is a configurable component of cluster

•Defines how the nodes are grouped together

•Types of snitches:

• SimpleSnitch

• BriskSimpleSnitch

• RackInferringSnitch

• PropertyFileSnitch

• EC2Snitch

• Dynamic Snitching

Page 10: Cassandra tech talk

Snitches…(contd)

10

Page 11: Cassandra tech talk

11

Why Use Cassandra?

•Very High Volume writes/reads•All writes HAVE to succeed•Horizontal scalability•Commodity HW•Integration with Hadoop/Hbase/HIVE•SQL Like usage•No Single point of failure•Powerful dynamic Schema data model• Maximum flexibility • Performance at scale

Page 13: Cassandra tech talk

LimitationsBe aware of these differences when you move

from a relational database to Cassandra.• No transactions,• No JOINs• No foreign keys and keys are immutable• Keys have to be unique• Failed operations may leave changes• Searching is complicated• Super columns and order preserving partitioners are

discouraged• Healing from failure is manual• It remembers deletes (until v0.8, at least)

13

Page 14: Cassandra tech talk

DEMO

Page 15: Cassandra tech talk

Questions?