data stax - lightning introduction to cassandra - marmite nosql

14
Lightning Introduction to Cassandra Michaël Figuière @mfiguiere

Upload: duchess-france

Post on 17-Jun-2015

1.312 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Data stax - lightning introduction to cassandra - Marmite NoSql

Lightning Introductionto Cassandra

Michaël Figuière@mfiguiere

Page 2: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Speaker

Michaël Figuière

@mfiguiere

2

Page 3: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Ring Architecture

CassandraNode

Node

NodeNode

Node

Node

3

Page 4: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Ring Architecture

4

Node

Node Replica

Replica

NodeReplica

Page 5: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Linear Scalability

5

Client Writes/s by Node Count - Replication Factor = 3

Page 6: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Client / Server Communication

Client

Client

Client

Client

Node?

Node

6

Replica

Replica

Replica

Node

Page 7: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Client / Server Communication

Client

Client

Client

Client

Node

Node

Coordinator node:Forwards all R/W requeststo corresponding replicas

7

Replica

Replica

ReplicaNode

Page 8: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Request Path

1

2

2

2

3

3

3

4

8

Client

Client

Client

Client

Node

Node

Node

Replica

Replica

Replica

Coordinator node

Page 9: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Column Family Data Model

9

Jonathan

name

[email protected]

email

123 main

address

TX

statejbellis

Daria

name

[email protected]

email

45 2nd st

address

CA

statedhutch

Eric

name

[email protected]

emailegilmore

Row Key Columns

Page 10: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

Column Family Data Model

10

dhutch egilmore datastax mzcassiejbellis

egilmoredhutch

datastax mzcassieegilmore

Row Key Columns

Page 11: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

CQL3 Data Model

11

gmason

user_id

1765

tweet_id

phenry

author

Give me liberty or give me death

body

PartitionKey

gmason 1742 gwashington I chopped down the cherry tree

ahamilton 1797 jadams A government of laws, not men

ahamilton 1742 gwashington I chopped down the cherry tree

RemainingKey

Timeline Table

Page 12: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

CQL3 Data Model

12

gmason

user_id

1765

tweet_id

phenry

author

Give me liberty or give me death

body

gmason 1742 gwashington I chopped down the cherry tree

ahamilton 1797 jadams A government of laws, not men

ahamilton 1742 gwashington I chopped down the cherry tree

Timeline Table

CREATE TABLE timeline ( user_id varchar, tweet_id uuid, author varchar, body varchar, PRIMARY KEY (user_id, tweet_id));

CQL

Page 13: Data stax - lightning introduction to cassandra - Marmite NoSql

©2012 DataStax

CQL3 Data Model

13

gmason

user_id

1765

tweet_id

phenry

author

Give me liberty or give me death

body

gmason 1742 gwashington I chopped down the cherry tree

ahamilton 1797 jadams A government of laws, not men

ahamilton 1742 gwashington I chopped down the cherry tree

gwashington

[1742, author]

I chopped down the...

[1742, body]

phenry

[1765, author]

Give me liberty or give...

[1765, body]gmason

gwashington

[1742, author]

I chopped down the...

[1742, body]

jadams

[1797, author]

A government of laws...

[1797, body]ahamilton

Timeline Table

Timeline Physical Layout

Page 14: Data stax - lightning introduction to cassandra - Marmite NoSql

@mfiguiere

blog.datastax.com

Stay Tuned!