coming to cassandra from relational world

26

Upload: nenad-bozic

Post on 13-Apr-2017

442 views

Category:

Data & Analytics


0 download

TRANSCRIPT

Page 1: Coming to Cassandra from Relational World
Page 2: Coming to Cassandra from Relational World

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

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

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

Agenda

• NoSQL space

• Cassandra architecture

• How (not) to start with Cassandra

• Cassandra learning path

Page 6: Coming to Cassandra from Relational World

NoSQL Space

Page 7: Coming to Cassandra from Relational World

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

http://bigdata-blog.com/key-value-database

Page 9: Coming to Cassandra from Relational World

Polyglot Persistence

http://martinfowler.com/bliki/PolyglotPersistence.html

Page 10: Coming to Cassandra from Relational World

Cassandra

Page 11: Coming to Cassandra from Relational World

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

Architecture

Client contact

Page 13: Coming to Cassandra from Relational World

Architecture

Client request

Consistency level 1Replication factor 3

Page 14: Coming to Cassandra from Relational World

Architecture

Client request

response

Consistency level 1Replication factor 3

Page 15: Coming to Cassandra from Relational World

Architecture

DC1 DC2

Cluster

Page 16: Coming to Cassandra from Relational World

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

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

Data Modeling

• query based modeling

• data is denormalized

• data is duplicated

Page 19: Coming to Cassandra from Relational World

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

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

Our Two Cents on Cassandra

Page 22: Coming to Cassandra from Relational World

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

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

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

Q&A

Page 26: Coming to Cassandra from Relational World

Thank you

Nenad Bozic@NenadBozicNs

SmartCatwww.smartcat.io

@SmartCat_io