KEMBAR78
Introduction to NoSQL & Apache Cassandra | PPTX
Introduction to NoSQL & Cassandra
chetan.baheti@synechron.com
2
RDBMS

3
Top Ranked (Source http://db-engines.com/en/ranking)

4
What is a relation database?

Thou shalt not break my rules

5
Problems?

6
7
SCALE-UP
vs
SCALE-OUT

8
Sharding

9
The Relational Model

OrderId

LineItemId

LineItems
OrderId

UserId

OrderDate

ShippingAddressId

Orders
UserId

Name

Users
AddressId

Street

City

Addresses

10
Unstructured data

11
RDBMS

NoSQL

12
What is NoSQL? (Source: http://nosql-database.org/ )

13
Key Value

Column Family

Graph

Document Store
14
Key Value Pair Databases

Usage: Briskly changing data and high availability. Example: Stock Quotes

15
Document Store Databases

Order-13235

Usage: Occasionally updated data. Example: Blogs, Content Mgmt Systems
16
Column family

Usage: Read/write intensive applications. Example: Social networking, Logs data
17
From Cassandra Tutorial http://www.datastax.com/docs/0.8/ddl/index

18
19
Graph Databases (Source http://markorodriguez.com/)
Stephen is a member of a graph-oriented engineering group called TinkerPop.
Stephen contributes to Rexster
Rexster is related to other projects via software dependencies.
When a user finds a bug in Rexster, they issue a ticket

Usage: Spatial data storage, networks.
Example: friends and family
associations on facebook
20
CAP Theorem (Source: http://blog.beany.co.kr/archives/275)

21
Atomicity
Consistency
Isolation
Durability

BAsically Available
Soft state
Eventually Consistent
22
Apache Cassandra

23
Who’s using Cassandra
(Source: http://www.slideshare.net/jbellis/cassandra-at-nosql-matters-2012)

24
Apache Cassandra

25
No-SPOF, Multi-master
(Source: http://www.slideshare.net/jbellis/cassandra-at-nosql-matters-2012)

No-SPOF

Single Point of Failure

26
Linear Scalability
(Source: http://www.datastax.com/documentation/cassandra/2.0/webhelp/index.html )

27
Partitioning
Chetan

24,235

John

18,789

Avani

34,923

#

Monty

Node D

Node A

8978

Start

End

1
10,000
Node B

19,999

20,000
Node C

9999
29,999

30,000

39,999

28
Terminology
Source: http://www.codeproject.com/Articles/279947/Migration-of-Relational-Data-structure-to-Cassandr

29
Terminology

RELATIONAL DATA
MODEL

SERVER
DATABASE/SCHEMA
TABLE
PRIMARY KEY
COLUMN VALUE

CASSANDRA DATA
MODEL (STANDARD)

CASSANDRA DATA
MODEL (SUPER)

CLUSTER
KEY SPACE
COLUMN FAMILY
KEY
COLUMN NAME
SUPER COLUMN NAME
COLUMN VALUE
COLUMN NAME
COLUMN VALUE

30
So how do we talk to Cassandra?

Thrift
31
Cassandra Query Language (CQL)

Cassandra 1.x
CREATE COLUMNFAMILY users

Cassandra 3.x
CREATE TABLE users

SQL

CQL

32
Cassandra Query Language (CQL)

33
Cassandra Query Language (CQL)

34
Kahaani Khatam Hone Ko Aayi,
Aur Saala Action Shuru Hi Nahin
Huwa

35
Critique

36
Too much Specialization?
(Source: http://parelastic.com/blog/nosql-vs-sql-hoopla-another-turn-screw)

37
38
Know your use case

39
RDBMS
NoSQL

40
Polyglot persistence (Source: http://www.martinfowler.com/bliki/PolyglotPersistence.html)

41
Feedback

https://www.surveymonkey.com/s/PSCC8WJ
42
References
http://architecture-soa-bpm-eai.blogspot.in/2011/08/limitations-of-relational-database.html
http://architects.dzone.com/articles/rdbms-vs-nosql
http://en.wikipedia.org/wiki/Codd's_12_rules
http://www.youtube.com/watch?v=qI_g07C_Q5I (Talk by Martin Fowler on NoSQL)
http://ayende.com/blog/4500/that-no-sql-thing-column-family-databases
http://ayende.com/blog/tags/nosql
http://www.julianbrowne.com/article/viewer/brewers-cap-theorem (Cap Theorem)
http://www.datastax.com/documentation/cassandra/2.0/webhelp/index.html
http://techblog.netflix.com/2011/11/benchmarking-cassandra-scalability-on.html
http://www.codeproject.com/Articles/279947/Migration-of-Relational-Data-structure-to-Cassandr

43

Introduction to NoSQL & Apache Cassandra