cassandra tech talk

Post on 15-Jan-2015

282 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

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

CASSANDRA

UDA SE Tech TalkSep 20 2012

2

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

3

CASSANDRA

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)

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

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.

Data Partitioning (Contd)

7

Partitioning in Multi-Data Center Clusters

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

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

Snitches…(contd)

10

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

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

DEMO

Questions?

top related