Coming to Cassandra from Relational World
-
Upload
nenad-bozic -
Category
Data & Analytics
-
view
442 -
download
0
Transcript of Coming to Cassandra from Relational World
![Page 1: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/1.jpg)
![Page 2: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/2.jpg)
Coming to Cassandra from Relational World
April 2016
Nenad [email protected]@smartcat.io
SmartCatwww.smartcat.io
@SmartCat_io
![Page 3: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/3.jpg)
Relational Databases
• easy to start with, need only SQL
• can be used without knowledge of internals
• we choose the vendor which we know best
• limitless indexes and query patterns
![Page 4: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/4.jpg)
We Live in Data Intensive Environment
• Everything is connected to internet, expansion of IoT, social networks
• 90% of stored data is gathered in the last 2 years
• Enterprise is moving to BASE
![Page 5: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/5.jpg)
Agenda
• NoSQL space
• Cassandra architecture
• How (not) to start with Cassandra
• Cassandra learning path
![Page 6: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/6.jpg)
NoSQL Space
![Page 7: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/7.jpg)
NoSQL
• they are not hype anymore
• not general purpose storage, built to solve specific use case
• built with performance and scalability in mind
• each type, even more, each vendor is different
![Page 8: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/8.jpg)
http://bigdata-blog.com/key-value-database
![Page 9: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/9.jpg)
Polyglot Persistence
http://martinfowler.com/bliki/PolyglotPersistence.html
![Page 10: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/10.jpg)
Cassandra
![Page 11: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/11.jpg)
Cassandra Overview
• Data is available, partitioned with tunable consistency
• Both data and load is distributed
• Replication factor - how many replicas
• Masterless architecture
• Fast, scalable and fault tolerant
• Native multi-datacenter support
![Page 12: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/12.jpg)
Architecture
Client contact
![Page 13: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/13.jpg)
Architecture
Client request
Consistency level 1Replication factor 3
![Page 14: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/14.jpg)
Architecture
Client request
response
Consistency level 1Replication factor 3
![Page 15: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/15.jpg)
Architecture
DC1 DC2
Cluster
![Page 16: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/16.jpg)
Single - Row Partitions
http://www.slideshare.net/planetcassandra/datastax-rigorous-cassandra-data-modeling-for-the-relational-data-architect
![Page 17: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/17.jpg)
Multi - Row Partitions
http://www.slideshare.net/planetcassandra/datastax-rigorous-cassandra-data-modeling-for-the-relational-data-architect
![Page 18: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/18.jpg)
Data Modeling
• query based modeling
• data is denormalized
• data is duplicated
![Page 19: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/19.jpg)
Use Cases
• when high availability is crucial, and eventual consistency is tolerable
• event sourcing
• logging continuous streams of data
• deep visitor analytics
• early prototyping with significant query changes
• referential integrity required
• dynamic access patterns on data
![Page 20: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/20.jpg)
Cassandra in Data Science
• native support for multi DC (main and analytics DC)
• Cassandra Spark connector with data locality
• Cassandra is suitable for web analytics
• SMACK stack - real time analytics
![Page 21: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/21.jpg)
Our Two Cents on Cassandra
![Page 22: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/22.jpg)
Red Flags - how not to start with Cassandra
• do not use Cassandra on single node
• watch out for write - read antipattern
• watch out for read - write antipattern
• change the way you model data, avoid relational data modeling
• do not be afraid of evolving data model
![Page 23: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/23.jpg)
Learning path
• watch Martin Fowler Introduction to NoSQL video
• read history (DynamoDB and BigTable)
• finish up DS201: Cassandra Core Concepts course
• finish up DS220: Data Modeling course
• bonus: listen to Patrick McFaddin on topic of data modeling
![Page 24: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/24.jpg)
Links
• SmartCat Blog post - How (not) to start with Cassandra
• SmartCat Blog post - Polyglot persistence in NoSQL space
• Kristof Kovacs - NoSQL database blog post
• Martin Fowler - Introduction to NoSQL
• DS201 - Cassandra Core Concepts
• DS220 - Data Modeling
![Page 25: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/25.jpg)
Q&A
![Page 26: Coming to Cassandra from Relational World](https://reader035.fdocuments.in/reader035/viewer/2022062523/58eecbd41a28abec438b4581/html5/thumbnails/26.jpg)
Thank you
Nenad Bozic@NenadBozicNs
SmartCatwww.smartcat.io
@SmartCat_io