Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

10/15/2020

Reading time:3 min

Data Modeling for Apache Cassandra

by DataStax Academy

Data Modeling for Apache Cassandra SlideShare Explore You Successfully reported this slideshow.Data Modeling for Apache CassandraUpcoming SlideShareLoading in …5× 0 Comments 1 Like Statistics Notes Imrankhan Patan , Solution Architect at Ericsson at Ericsson No DownloadsNo notes for slide 1. data modeling for apachecassandrawith a sprinkle of C* background and some time series fundani traphagen@dtrapezoid 2. quiz time - who is this? 3. buthowdo Ieven? 4. query driven methodologyconceptual datamodelaccess patternsmappingrules andpatternslogical datamodelerd queriesdiagram it 5. conceptual data modeling• abstract view of the domain• technology independent• not specific to any database system 6. entity relationship diagram• entity types• relationship types• attribute types 7. relationship keys 8. attribute key participation• relationship attributes can make partof the key 9. full conceptual model 10. query driven methodologyconceptual datamodelaccess patternsmappingrules andpatternslogical datamodelerd queriesdiagram it 11. application workflow• each application has a workflow• access patterns help us get how datais accessed• know your queries you will run beforeyou design your model 12. application workflow 13. query driven methodologyconceptual datamodelaccess patternsmappingrules andpatternslogical datamodelerd queriesdiagram it 14. mapping rules & patterns• mapping rules ensure that a logicaldata model is right• each query has a corresponding table• tables are designed to allow queries toexecute properly• tables return data in the correct order 15. mapping rules1. entities andrelationships2. equality searchattributes3. inequality searchattributes4. ordering attributes5. key attributes 16. entities and relationships1. entity and relationship types map totables2. entities and relationships map topartitions or rows3. partition may have data about one ormore entities and relationships4. attributes are represented bycolumns 17. entities and relationships 18. Each relationship becomes a row in the tableRelationship type attributes are represented by columnsQueries and relationship cardinality affects the design of the primary key• each relationship becomes a row in the table• relationship type attributes are represented by columns• queries and relationship cardinality affects the designof the primary key 19. equality search attributes• equality search attributes becomeinitial columns of a primary key• querying on: title and type 20. inequality search attributes• clustering columns follow partitionkey columns in a primary key• the column involved in an inequalitysearch must come after columns inthe primary key that are used in anequality search 21. ordering attributes1. ordering attributes become clustering columns2. querying on: user_id = ? anduploaded_timestamp > ?3. ordering attributes : uploaded_timestamp (DESC) 22. key attributes1. relationship type key attributes are included asprimary key columns2. queries affect primary key design 23. query driven methodologyconceptual datamodelaccess patternsmappingrules andpatternslogical datamodelerd queriesdiagram it 24. logical data model 25. thissucksa real world example, w/time series data 26. This is using simple strategy, but don’t do that in prod PLEASE! 27. time series bucketing 28. well dani this is all great andeverything…but just how do i getstarted? hm? i mean i want to learncassandra and try it and everythingbut it is just so daunting. i meanyou showed me all this stuff and iam overwhelmed and it is sort ofmaking me insecure. what exactlydo i do next to learn more? how do ireally dig in and learn theseconcepts? have you thought aboutthat? have you thought about what iNEED?HMMMM DANI, HAVEYOU??!!!!!!!!!!11 29. & prepare to be wowed 30. cdmhttps://github.com/riptano/cdmcdm preview 31. namastebut what doesit all mean?also, we’rehiring Recommended Cassandra 3.0 Data ModelingDataStax Academy Forrester CXNYC 2017 - Delivering great real-time cx is a true craftDataStax Academy Introduction to DataStax Enterprise Graph DatabaseDataStax Academy Introduction to DataStax Enterprise Advanced Replication with Apache CassandraDataStax Academy Cassandra on Docker @ Walmart LabsDataStax Academy Cassandra Adoption on Cisco UCS & Open stackDataStax Academy Coursera Cassandra DriverDataStax Academy About Blog Terms Privacy Copyright × Public clipboards featuring this slideNo public clipboards found for this slideSelect another clipboard ×Looks like you’ve clipped this slide to already.Create a clipboardYou just clipped your first slide! Clipping is a handy way to collect important slides you want to go back to later. Now customize the name of a clipboard to store your clips. Description Visibility Others can see my Clipboard

Illustration Image
Data Modeling for Apache Cassandra

Successfully reported this slideshow.

Data Modeling for Apache Cassandra
data modeling for apache
cassandra
with a sprinkle of C* background and some time series fun
dani traphagen
@dtrapezoid
quiz time - who is this?
but
how
do I
even
?
query driven methodology
conceptual data
model
access patterns
mapping
rules and
patterns
logical data
model
erd queries
d...
conceptual data modeling
• abstract view of the domain
• technology independent
• not specific to any database system
entity relationship diagram
• entity types
• relationship types
• attribute types
relationship keys
attribute key participation
• relationship attributes can make part
of the key
full conceptual model
query driven methodology
conceptual data
model
access patterns
mapping
rules and
patterns
logical data
model
erd queries
d...
application workflow
• each application has a workflow
• access patterns help us get how data
is accessed
• know your quer...
application workflow
query driven methodology
conceptual data
model
access patterns
mapping
rules and
patterns
logical data
model
erd queries
d...
mapping rules & patterns
• mapping rules ensure that a logical
data model is right
• each query has a corresponding table
...
mapping rules
1. entities and
relationships
2. equality search
attributes
3. inequality search
attributes
4. ordering attr...
entities and relationships
1. entity and relationship types map to
tables
2. entities and relationships map to
partitions ...
entities and relationships
Each	relationship	becomes	a	row	in	the	table
Relationship	type	attributes	are	represented	by	columns
Queries	and	relations...
equality search attributes
• equality search attributes become
initial columns of a primary key
• querying on: title and t...
inequality search attributes
• clustering columns follow partition
key columns in a primary key
• the column involved in a...
ordering attributes
1. ordering attributes become clustering columns
2. querying on: user_id = ? and
uploaded_timestamp > ...
key attributes
1. relationship type key attributes are included as
primary key columns
2. queries affect primary key design
query driven methodology
conceptual data
model
access patterns
mapping
rules and
patterns
logical data
model
erd queries
d...
logical data model
this
sucks
a real world example, w/time series data
This	is	using	simple	strategy,	but	don’t	do	that	in	prod	PLEASE!
time series bucketing
well dani this is all great and
everything…but just how do i get
started? hm? i mean i want to learn
cassandra and try it ...
& prepare to be wowed
cdm
https://github.com/riptano/cdm
cdm preview
namaste
but what does
it all mean?
also, we’re
hiring
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
Data Modeling for Apache Cassandra

Upcoming SlideShare

Loading in …5

×

  1. 1. data modeling for apache cassandra with a sprinkle of C* background and some time series fun dani traphagen @dtrapezoid
  2. 2. quiz time - who is this?
  3. 3. but how do I even ?
  4. 4. query driven methodology conceptual data model access patterns mapping rules and patterns logical data model erd queries diagram it
  5. 5. conceptual data modeling • abstract view of the domain • technology independent • not specific to any database system
  6. 6. entity relationship diagram • entity types • relationship types • attribute types
  7. 7. relationship keys
  8. 8. attribute key participation • relationship attributes can make part of the key
  9. 9. full conceptual model
  10. 10. query driven methodology conceptual data model access patterns mapping rules and patterns logical data model erd queries diagram it
  11. 11. application workflow • each application has a workflow • access patterns help us get how data is accessed • know your queries you will run before you design your model
  12. 12. application workflow
  13. 13. query driven methodology conceptual data model access patterns mapping rules and patterns logical data model erd queries diagram it
  14. 14. mapping rules & patterns • mapping rules ensure that a logical data model is right • each query has a corresponding table • tables are designed to allow queries to execute properly • tables return data in the correct order
  15. 15. mapping rules 1. entities and relationships 2. equality search attributes 3. inequality search attributes 4. ordering attributes 5. key attributes
  16. 16. entities and relationships 1. entity and relationship types map to tables 2. entities and relationships map to partitions or rows 3. partition may have data about one or more entities and relationships 4. attributes are represented by columns
  17. 17. entities and relationships
  18. 18. Each relationship becomes a row in the table Relationship type attributes are represented by columns Queries and relationship cardinality affects the design of the primary key • each relationship becomes a row in the table • relationship type attributes are represented by columns • queries and relationship cardinality affects the design of the primary key
  19. 19. equality search attributes • equality search attributes become initial columns of a primary key • querying on: title and type
  20. 20. inequality search attributes • clustering columns follow partition key columns in a primary key • the column involved in an inequality search must come after columns in the primary key that are used in an equality search
  21. 21. ordering attributes 1. ordering attributes become clustering columns 2. querying on: user_id = ? and uploaded_timestamp > ? 3. ordering attributes : uploaded_timestamp (DESC)
  22. 22. key attributes 1. relationship type key attributes are included as primary key columns 2. queries affect primary key design
  23. 23. query driven methodology conceptual data model access patterns mapping rules and patterns logical data model erd queries diagram it
  24. 24. logical data model
  25. 25. this sucks a real world example, w/time series data
  26. 26. This is using simple strategy, but don’t do that in prod PLEASE!
  27. 27. time series bucketing
  28. 28. well dani this is all great and everything…but just how do i get started? hm? i mean i want to learn cassandra and try it and everything but it is just so daunting. i mean you showed me all this stuff and i am overwhelmed and it is sort of making me insecure. what exactly do i do next to learn more? how do i really dig in and learn these concepts? have you thought about that? have you thought about what i NEED? HMMMM DANI, HAVE YOU??!!!!!!!!!!11
  29. 29. & prepare to be wowed
  30. 30. cdm https://github.com/riptano/cdm cdm preview
  31. 31. namaste but what does it all mean? also, we’re hiring

×

Related Articles

data.modeling
cassandra

Search key of big partition in cassandra

John Doe

2/17/2023

data.modeling
cassandra
spark

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

data.modeling