SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
Introduction
to
Cassandra
Michał Matłoka @mmatloka
CASSANDRA
Cassandra by Evelyn De Morgan (1898, London)
• First release in 2008
• Supported versions: 2.1.x, 2.2.x, 3.0.x,
3.x
• Used by Apple, Netflix, eBay, Reddit, …
• Big Data (Volume, Velocity, Variety)
• (Near-linear) horizontal scalability
• Fully distributed, no SPoF
• Data Replication
• Modelling include data duplication
–ThoughtWorks Technology Radar
“It’s a great tool and we like it, but too often we see
teams run into trouble using it. We recommend
using Cassandra carefully. Teams often
misunderstand the use case for Cassandra,
attempting to use it as a general-purpose data
store when in fact it is optimized for fast reads
on large data sets based on predefined keys or
indexes. (…)”
VERTICAL SCALING
CAP
theorem
In distributed
system you can
only have two of
three guarantees:
• Consistency
• Availability
• Partition
Tolerance
(Brewer’s theorem)
Source: http://blog.nahurst.com/visual-guide-to-nosql-systems
Relational scaling
(horizontal)
Example limitations:
• Max 48 nodes
• Read-only nodes
• Cross-shard joins…
• Auto-increments
• Distributed transactions,
possible, but…
NoSQL (Not Only SQL)
• Key-value (Redis, Dynamo, ...)
• Column (Cassandra, HBase, ...)
• Document (MongoDB, … )
• Graph (Neo4J, … )
• Multi-model (OrientDB, …)
Atomicity
Consistency
Isolation
Durability
Basically
Available
Soft state
Eventual consistency
• Keyspace
• Table
• Partition (set of rows)
• Row (columns & cells)
Table
CLUSTER STRUCTURE
-2^63
2^63
-1
Murmur3
Token ring
Write
Read
Write
Read
CL => Tunable Consistency
• ONE
• TWO
• THREE
• ALL
• QUORUM
• LOCAL_QUORUM
• …
Immediate consistency
Read consistency + Write consistency > Replication Factor
• QUORUM + QUORUM
• ONE + ALL
• ALL + ONE
WRITE DETAILS
Write path
Compaction (SizeTiered)
MODELING METHODOLOGY
Modeling Methodology
Chebotko Diagram
CREATE TABLE potatoes_by_group (
group text,
name text,
photo_id uuid,
PRIMARY KEY (group, name)
);
INSERT INTO potatoes_by_group (group, name, photo_id) values
('RED', 'Red Bliss', d4b2732b-d035-4034-8e13-a7c17af25c36);
SELECT * FROM potatoes_by_group WHERE group = 'RED';
CQL
• Secondary index
• Materialized view (>= 3.0)
• SASI Index (>= 3.4)
• Table per query
• Hinted handoff
• Read repair
• Repair
• Tombstones
Other mechanisms
When to use Cassandra?
• Heavy writes
• Time series - sensor data/IoT
• Play list (Spotify)
• Messaging
• Fraud detection
• …
Learning materials
• https://www.thoughtworks.com/radar/
platforms/cassandra-carefully
• https://www.infoq.com/articles/cap-
twelve-years-later-how-the-rules-have-
changed
• https://academy.datastax.com/courses/
Thank you, Q&A?
@mmatloka
mmatloka
softwaremill.com/blog

Contenu connexe

Tendances

Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
Markus Klems
 
Cassandra overview
Cassandra overviewCassandra overview
Cassandra overview
Sean Murphy
 
Cassandra Tutorial
Cassandra TutorialCassandra Tutorial
Cassandra Tutorial
mubarakss
 

Tendances (20)

Introduction to Cassandra
Introduction to CassandraIntroduction to Cassandra
Introduction to Cassandra
 
Cassandra background-and-architecture
Cassandra background-and-architectureCassandra background-and-architecture
Cassandra background-and-architecture
 
Apache Cassandra @Geneva JUG 2013.02.26
Apache Cassandra @Geneva JUG 2013.02.26Apache Cassandra @Geneva JUG 2013.02.26
Apache Cassandra @Geneva JUG 2013.02.26
 
Introduction to NoSQL & Apache Cassandra
Introduction to NoSQL & Apache CassandraIntroduction to NoSQL & Apache Cassandra
Introduction to NoSQL & Apache Cassandra
 
NOSQL Database: Apache Cassandra
NOSQL Database: Apache CassandraNOSQL Database: Apache Cassandra
NOSQL Database: Apache Cassandra
 
Cassandra 101
Cassandra 101Cassandra 101
Cassandra 101
 
Cassandra overview
Cassandra overviewCassandra overview
Cassandra overview
 
Intro to Cassandra
Intro to CassandraIntro to Cassandra
Intro to Cassandra
 
Cassandra an overview
Cassandra an overviewCassandra an overview
Cassandra an overview
 
Cassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + DynamoCassandra: Open Source Bigtable + Dynamo
Cassandra: Open Source Bigtable + Dynamo
 
Cassandra ppt 2
Cassandra ppt 2Cassandra ppt 2
Cassandra ppt 2
 
Apache Cassandra at the Geek2Geek Berlin
Apache Cassandra at the Geek2Geek BerlinApache Cassandra at the Geek2Geek Berlin
Apache Cassandra at the Geek2Geek Berlin
 
Cassandra Architecture FTW
Cassandra Architecture FTWCassandra Architecture FTW
Cassandra Architecture FTW
 
Cassandra training
Cassandra trainingCassandra training
Cassandra training
 
Cassandra Database
Cassandra DatabaseCassandra Database
Cassandra Database
 
Presentation of Apache Cassandra
Presentation of Apache Cassandra Presentation of Apache Cassandra
Presentation of Apache Cassandra
 
Cassandra Tutorial
Cassandra TutorialCassandra Tutorial
Cassandra Tutorial
 
Understanding Data Partitioning and Replication in Apache Cassandra
Understanding Data Partitioning and Replication in Apache CassandraUnderstanding Data Partitioning and Replication in Apache Cassandra
Understanding Data Partitioning and Replication in Apache Cassandra
 
Apache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and BasicsApache Cassandra training. Overview and Basics
Apache Cassandra training. Overview and Basics
 
Cassandra - A decentralized storage system
Cassandra - A decentralized storage systemCassandra - A decentralized storage system
Cassandra - A decentralized storage system
 

Similaire à Introduction to Cassandra

Cassandra
CassandraCassandra
Cassandra
exsuns
 

Similaire à Introduction to Cassandra (20)

NoSQL - Cassandra & MongoDB.pptx
NoSQL -  Cassandra & MongoDB.pptxNoSQL -  Cassandra & MongoDB.pptx
NoSQL - Cassandra & MongoDB.pptx
 
An Introduction to Cassandra - Oracle User Group
An Introduction to Cassandra - Oracle User GroupAn Introduction to Cassandra - Oracle User Group
An Introduction to Cassandra - Oracle User Group
 
Cassandra - A Distributed Database System
Cassandra - A Distributed Database System Cassandra - A Distributed Database System
Cassandra - A Distributed Database System
 
Outside The Box With Apache Cassnadra
Outside The Box With Apache CassnadraOutside The Box With Apache Cassnadra
Outside The Box With Apache Cassnadra
 
Cassandra
CassandraCassandra
Cassandra
 
Cassandra
CassandraCassandra
Cassandra
 
Cassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting dataCassandra implementation for collecting data and presenting data
Cassandra implementation for collecting data and presenting data
 
Modern software design in Big data era
Modern software design in Big data eraModern software design in Big data era
Modern software design in Big data era
 
Apache Cassandra, part 1 – principles, data model
Apache Cassandra, part 1 – principles, data modelApache Cassandra, part 1 – principles, data model
Apache Cassandra, part 1 – principles, data model
 
Introduction to Apache Cassandra
Introduction to Apache CassandraIntroduction to Apache Cassandra
Introduction to Apache Cassandra
 
Introduction to Cassandra - Denver
Introduction to Cassandra - DenverIntroduction to Cassandra - Denver
Introduction to Cassandra - Denver
 
Cassandra Day Denver 2014: Introduction to Apache Cassandra
Cassandra Day Denver 2014: Introduction to Apache CassandraCassandra Day Denver 2014: Introduction to Apache Cassandra
Cassandra Day Denver 2014: Introduction to Apache Cassandra
 
Cassandra - how to fail?
Cassandra - how to fail?Cassandra - how to fail?
Cassandra - how to fail?
 
Spark and cassandra (Hulu Talk)
Spark and cassandra (Hulu Talk)Spark and cassandra (Hulu Talk)
Spark and cassandra (Hulu Talk)
 
cassandra_presentation_final
cassandra_presentation_finalcassandra_presentation_final
cassandra_presentation_final
 
Apache cassandra
Apache cassandraApache cassandra
Apache cassandra
 
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
Vitalii Bondarenko - “Azure real-time analytics and kappa architecture with K...
 
6269441.ppt
6269441.ppt6269441.ppt
6269441.ppt
 
Cassandra for mission critical data
Cassandra for mission critical dataCassandra for mission critical data
Cassandra for mission critical data
 
Introduction to NoSQL CassandraDB
Introduction to NoSQL CassandraDBIntroduction to NoSQL CassandraDB
Introduction to NoSQL CassandraDB
 

Plus de SoftwareMill

Plus de SoftwareMill (20)

Growing Oxen: channel operators and retries
Growing Oxen: channel operators and retriesGrowing Oxen: channel operators and retries
Growing Oxen: channel operators and retries
 
How To Survive a Live-Coding Session
How To Survive a Live-Coding SessionHow To Survive a Live-Coding Session
How To Survive a Live-Coding Session
 
Goryle i ser szwajcarski. Czego medycyna ratunkowa może Cię nauczyć o tworzen...
Goryle i ser szwajcarski. Czego medycyna ratunkowa może Cię nauczyć o tworzen...Goryle i ser szwajcarski. Czego medycyna ratunkowa może Cię nauczyć o tworzen...
Goryle i ser szwajcarski. Czego medycyna ratunkowa może Cię nauczyć o tworzen...
 
Have you ever wondered about code review?
Have you ever wondered about code review?Have you ever wondered about code review?
Have you ever wondered about code review?
 
Reactive Integration with Akka Streams and Alpakka
Reactive Integration with Akka Streams and AlpakkaReactive Integration with Akka Streams and Alpakka
Reactive Integration with Akka Streams and Alpakka
 
W świecie botów czyli po co nam SI
W świecie botów czyli po co nam SIW świecie botów czyli po co nam SI
W świecie botów czyli po co nam SI
 
Small intro to Big Data
Small intro to Big DataSmall intro to Big Data
Small intro to Big Data
 
Out-of-the-box Reactive Streams with Java 9
Out-of-the-box Reactive Streams with Java 9Out-of-the-box Reactive Streams with Java 9
Out-of-the-box Reactive Streams with Java 9
 
Hiring, Bots and Beer. (Hiring in the IT industry)
Hiring, Bots and Beer. (Hiring in the IT industry) Hiring, Bots and Beer. (Hiring in the IT industry)
Hiring, Bots and Beer. (Hiring in the IT industry)
 
Teal Is The New Black
Teal Is The New BlackTeal Is The New Black
Teal Is The New Black
 
Windowing data in big data streams
Windowing data in big data streamsWindowing data in big data streams
Windowing data in big data streams
 
Kafka as a message queue
Kafka as a message queueKafka as a message queue
Kafka as a message queue
 
Origins of Free
Origins of FreeOrigins of Free
Origins of Free
 
How to manage in a flat organized, remote and transparent company
How to manage in a flat organized, remote and transparent companyHow to manage in a flat organized, remote and transparent company
How to manage in a flat organized, remote and transparent company
 
Performance tests with gatling
Performance tests with gatlingPerformance tests with gatling
Performance tests with gatling
 
Origins of free
Origins of freeOrigins of free
Origins of free
 
Projekt z punktu widzenia UX designera
Projekt z punktu widzenia UX designeraProjekt z punktu widzenia UX designera
Projekt z punktu widzenia UX designera
 
Machine learning by example
Machine learning by exampleMachine learning by example
Machine learning by example
 
Open source big data landscape and possible ITS applications
Open source big data landscape and possible ITS applicationsOpen source big data landscape and possible ITS applications
Open source big data landscape and possible ITS applications
 
Jednorożce to kobiety a nie firmy. O √kobiecym w STEM
Jednorożce to kobiety a nie firmy. O √kobiecym w STEMJednorożce to kobiety a nie firmy. O √kobiecym w STEM
Jednorożce to kobiety a nie firmy. O √kobiecym w STEM
 

Dernier

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Dernier (20)

Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 

Introduction to Cassandra