SlideShare a Scribd company logo
Advantages of Cassandra’s
masterless architecture
Duy Lam @ RD
KMS TechCon 2015
Masterless
Architecture
Cautions
Introduction
An Apache
Software
Foundation
project
Built on
Java
DataStax
Masterless
Architecture
Cautions
Masterless Architecture
Peer-to-peer
Database
Automatic
Data
Distribution
Built-in
Replication
Masterless Architecture
Cassandra cluster
Background
service
Web
service
Application
Peer-to-peer
Database
Automatic Data
Distribution
Built-in Replication
No SPOF
A node
Masterless Architecture
Peer-to-peer
Database
Automatic Data
Distribution
Built-in Replication
partition id name
usa_1994 ae12f… The Shawshank Redemption
usa_1994 bb2ac… Forrest Gump
skorea_2002 31dcc… The Way Home
vn_2015 890af… Jackpot
2
usa_1994 ae… The Sha..
usa_1994 bb… Forrest..
1 skorea_2002 31… The Way …
3 vn_2015 89… Jackpot
Cassandra cluster
CREATE TABLE movie (
partition text ,
id uuid,
name text
)
Masterless Architecture
Peer-to-peer
Database
Automatic Data
Distribution
Built-in Replication
partition id name
(A)
usa_1994 ae12f… The Shawshank Redemption
usa_1994 bb2ac… Forrest Gump
(B) skorea_2002 31dcc… The Way Home
(C) vn_2015 890af… Jackpot
2
1
3
Cassandra cluster
CREATE TABLE movie (
partition text ,
id uuid,
name text
)
(B) (A’) (C’)
(A) (B’) (C’)
(C) (A’) (B’)
The Advantages
Peer-to-peer
Database
Automatic Data
Distribution
Built-in
Replication
?
The Advantages
Peer-to-peer
Database
Automatic Data
Distribution
Built-in
Replication
High
Availability
Fault
Tolerance
Scalability
Demo now
Fault
Tolerance
Scalability
High
Availability
Masterless
Architecture
Cautions
Cautions
Cassandra is from NoSQL family
So
?
Cautions
Cassandra is from NoSQL family
So
 Different data modeling (try to google “nosql
data modeling”)
 No Atomicity for multiple tables (or
“documents”)  no transaction
 Not good at complex query (group by, having,
like, >=, etc.)
Cautions
CREATE TABLE movie (
partition text, id uuid,
name text, released_year int, country text,
PRIMARY KEY (partition, id)
)
Limited query capability in Cassandra
SELECT * FROM movie WHERE
release_year < 2000
name LIKE “Star Trek”
name IN ( “Tangled”, “Frozen” )
name = “Inside Out” and year = 2015
length = null
length = 120 OR release_year = 2015
UPDATE movie SET length=95 WHERE partition = “vn” AND id = 10
INSERT INTO movie(partition, id, length) VALUES(“usa”, 15, 120)
(1)
(2)
(3)
(4)
(5)
(6)
Cautions
CREATE TABLE movie (
partition text, id uuid,
name text, released_year int, country text,
PRIMARY KEY (partition, id)
)
Limited query capability in Cassandra
SELECT * FROM movie WHERE
release_year < 2000
name LIKE “Star Trek”
name IN ( “Tangled”, “Frozen” )
name = “Inside Out” and year = 2015
length = null
length = 120 OR release_year = 2015
UPDATE movie SET length=95 WHERE partition = “vn” AND id = 10
INSERT INTO movie(partition, id, length) VALUES(“usa”, 15, 120)
(1)
(2)
(3)
(4)
(5)
(6)
References
DataStax Cassandra Tutorials
https://www.youtube.com/playlist?list=PL3E5AC388940EEC0A
(thanks to Provision feature) Launch
Cassandra clustering system at
http://bit.ly/kms-techcon2015-cassandra-demo
Take Away
Masterless Architecture
– Peer-to-peer Database
– Automatic Data Distribution
– Built-in Replication
Cautions
– Cassandra is from NoSQL family
– Limited query capability
THANKS YOU

More Related Content

PPT
Espanol el corte ingles
PDF
The inner workings of Dynamo DB
PPTX
Introduction to aws dynamo db
DOCX
Dynamo db pros and cons
PPT
7. Key-Value Databases: In Depth
PDF
Oracle to Cassandra Core Concepts Guide Pt. 2
PDF
DataStax: Old Dogs, New Tricks. Teaching your Relational DBA to fetch
PDF
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...
Espanol el corte ingles
The inner workings of Dynamo DB
Introduction to aws dynamo db
Dynamo db pros and cons
7. Key-Value Databases: In Depth
Oracle to Cassandra Core Concepts Guide Pt. 2
DataStax: Old Dogs, New Tricks. Teaching your Relational DBA to fetch
Beyond the Query – Bringing Complex Access Patterns to NoSQL with DataStax - ...

Similar to Advantages of Cassandra's masterless architecture (20)

PDF
Cassandra lesson learned - extended
PDF
A Cassandra + Solr + Spark Love Triangle Using DataStax Enterprise
PDF
Cassandra, web scale no sql data platform
PDF
Introduction to Data Modeling with Apache Cassandra
PDF
Cassandra - lesson learned
TXT
PDF
Beyond the Query: A Cassandra + Solr + Spark Love Triangle Using Datastax Ent...
PDF
November Camp - Spec BDD with PHPSpec 2
PDF
Enter the Snake Pit for Fast and Easy Spark
PDF
Data Science - The Most Profitable Movie Characteristic
PDF
Advanced Data Modeling with Apache Cassandra
PDF
Building a Bridge between Terraform and ArgoCD
PDF
Kief Morris - Infrastructure is terrible
DOCX
Modify Assignment 5 toReplace the formatted output method (toStri.docx
PDF
Atmosphere Conference 2015: Taming the Modern Datacenter
PPTX
GraphFrames Access Methods in DSE Graph
PDF
Using Stargate APIs for Cassandra-Backed Applications
PPTX
Analytics with Cassandra, Spark & MLLib - Cassandra Essentials Day
PDF
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
Cassandra lesson learned - extended
A Cassandra + Solr + Spark Love Triangle Using DataStax Enterprise
Cassandra, web scale no sql data platform
Introduction to Data Modeling with Apache Cassandra
Cassandra - lesson learned
Beyond the Query: A Cassandra + Solr + Spark Love Triangle Using Datastax Ent...
November Camp - Spec BDD with PHPSpec 2
Enter the Snake Pit for Fast and Easy Spark
Data Science - The Most Profitable Movie Characteristic
Advanced Data Modeling with Apache Cassandra
Building a Bridge between Terraform and ArgoCD
Kief Morris - Infrastructure is terrible
Modify Assignment 5 toReplace the formatted output method (toStri.docx
Atmosphere Conference 2015: Taming the Modern Datacenter
GraphFrames Access Methods in DSE Graph
Using Stargate APIs for Cassandra-Backed Applications
Analytics with Cassandra, Spark & MLLib - Cassandra Essentials Day
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
Ad

More from Duy Lâm (7)

PPTX
KMS TechCon 2014 - Interesting in JavaScript
PPTX
Building Single-page Web Applications with AngularJS @ TechCamp Sai Gon 2014
PPTX
Mocha
PPTX
Refactoring group 1 - chapter 3,4,6
PPTX
Amazon Web Services
PPTX
Overview of character encoding
PPTX
Microsoft Windows Azure in short
KMS TechCon 2014 - Interesting in JavaScript
Building Single-page Web Applications with AngularJS @ TechCamp Sai Gon 2014
Mocha
Refactoring group 1 - chapter 3,4,6
Amazon Web Services
Overview of character encoding
Microsoft Windows Azure in short
Ad

Recently uploaded (20)

PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
medical staffing services at VALiNTRY
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PPTX
assetexplorer- product-overview - presentation
PDF
Cost to Outsource Software Development in 2025
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Salesforce Agentforce AI Implementation.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
L1 - Introduction to python Backend.pptx
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
AutoCAD Professional Crack 2025 With License Key
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PDF
Nekopoi APK 2025 free lastest update
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PDF
Digital Systems & Binary Numbers (comprehensive )
Download FL Studio Crack Latest version 2025 ?
Navsoft: AI-Powered Business Solutions & Custom Software Development
medical staffing services at VALiNTRY
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
assetexplorer- product-overview - presentation
Cost to Outsource Software Development in 2025
Design an Analysis of Algorithms II-SECS-1021-03
Salesforce Agentforce AI Implementation.pdf
Design an Analysis of Algorithms I-SECS-1021-03
L1 - Introduction to python Backend.pptx
Wondershare Filmora 15 Crack With Activation Key [2025
CHAPTER 2 - PM Management and IT Context
AutoCAD Professional Crack 2025 With License Key
Patient Appointment Booking in Odoo with online payment
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Advanced SystemCare Ultimate Crack + Portable (2025)
Nekopoi APK 2025 free lastest update
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
Digital Systems & Binary Numbers (comprehensive )

Advantages of Cassandra's masterless architecture

Editor's Notes

  • #4: Open source, backed by big sponsor, commercial use Hosted by any platform A company provides many things around Cassandra (documentation, tools, etc.) both free and commercial Note: products using Cassandra listed in slide are more about user-generated content
  • #6: 03 characteristic make Cassandra becoming preferable choice for Big Data
  • #7: Eliminate SPOF and gain (single point of failure) App can connect to another node if the current node is shutdown Processing capability is spread out
  • #8: Partitioner: a function for deriving a token representing a row from its partition key (typically by hashing). A partitioner determines how data is distributed across the nodes in the cluster (including replicas) Cassandra offers the following partitioners: (from Cassandra v1.2+) Murmur3Partitioner (default): uniformly distributes data across the cluster based on MurmurHash (better than MD5 in term of distribution purpose) hash values. RandomPartitioner: uniformly distributes data across the cluster based on MD5 hash values. ByteOrderedPartitioner: keeps an ordered distribution of data lexically by key bytes
  • #9: Replicate factor: the total number of replicas across the cluster. A replication factor of 1 means that there is only one copy of each row on one node Replication strategy: a replication strategy determines which nodes to place replicas on
  • #10: Summarize things
  • #11: Peer-to-peer  High Availability Data Distribution  Scalability Replication  Fault Tolerance
  • #12: Prepare Start guest OS: vagrant up Launch 5 terminal and remote to guest OS in all of them. From now on, below commands are executed in remote SSH terminals Launch Cassandra seed node. When it’s fully starting, launch remaining Cassandra nodes Explain setup.cql file Setup schema and seed data: $ ~/apps/cassandra/bin/cqlsh -f ~/provision/setup.cql High Availability Insert new row in node2 (127.0.0.2): $ ~/apps/cassandra/bin/cqlsh -e "USE techcon2015; INSERT INTO participant(department, employee_id, name) VALUES (‘Delivery', 100, 'Nguyen Van An');" 127.0.0.2 See new row in seed node (127.0.0.4): $ ~/apps/cassandra/bin/cqlsh -e "USE techcon2015; select * from participant;" 127.0.0.4  Data is available on any node Fault Tolerance Show the node status: $ ~/apps/cassandra/bin/nodetool status (explain the status and state) Shutdown node2 (127.0.0.2) Show the node status again, indicate the Down status Show that data is still available: $ ~/apps/cassandra/bin/cqlsh -e "USE techcon2015; select * from participant;" 127.0.0.x (x is the other alive IP) Insert new row in seed node (127.0.0.4): $ ~/apps/cassandra/bin/cqlsh -e "USE techcon2015; INSERT INTO participant(department, employee_id, name) VALUES (‘Delivery', 200, 'Nguyen Van Chau');" 127.0.0.4 See new row in seed node (127.0.0.4): $ ~/apps/cassandra/bin/cqlsh -e "USE techcon2015; select * from participant;" 127.0.0.x (x is the other alive IP) No downtime for disconnected node Scalability Show the node status: $ ~/apps/cassandra/bin/nodetool status Remove node 127.0.0.2: $ ~/apps/cassandra/bin/nodetool -h 127.0.0.1 -p 7182 decommission (1782 is node2 jmx port) Show the node status again (indicate node removed): $ ~/apps/cassandra/bin/nodetool status Shutdown node 127.0.0.2 Restart node 127.0.0.2 to join again Cluster can be effortlessly reduced (or increased)
  • #15: google term “nosql data modeling” to see more explanation No transaction (commit, fallback) (from experience in Cassandra and mongo)