C* Summit 2013: The World's Next Top Data Model
Why Stack Overflow recommends it
Stack Overflow users link it when answering Cassandra questions about denormalization, materialized-view-style tables, composite keys and why joins and "not in" queries do not fit the model.
Recommended by 2 people across 3 different months, 2013 to 2015.
What it is
A conference talk from the 2013 Cassandra Summit in which DataStax solutions architect Patrick McFadin explains how to design data models in Cassandra. It covers storing objects, indexing for fast retrieval, and the internals that shape a good model across the application lifecycle.
What people said
Recommends jbellis · 2013-10 · Stack Overflow · on “Super column families in cassandra”
Supercolumns have been deprecated for years. Some modern data modeling resources include DataStax's introduction to data modeling in Cassandra [LINK] and Patrick McFadin's three-part series: The Data Model is Dead; Long live the Data Model [LINK] Become a Super Modeler [LINK] The World's Next Top Data Model [this video]
Recommends RussS · 2013-11 · Stack Overflow · on “Does Cassandra provide Materialized Views”
When using Cassandra DB almost all of your tables should essentially be materialized views (IE every table should be the answer to a query you want to preform). You then update them on the application side of your program. Obviously this will require some duplication of data but since writes in Cassandra are cheap this is the preferred way of modeling. For more information check out these links C* Summit 2013: The World's Next Top Data Mode [this video] [LINK]
Recommends RussS · 2015-02 · Stack Overflow · on “Cassandra internal working without joins”
The short answer is that you do not get data from multiple tables. The long answer is that you plan your data model such that your tables all answer specific questions of your application. This makes it so that no query ever requires data from more than one table. So if for example your application requires data about particular users you would build a table that is structured around looking up information given a particular user. The analogy in the RDBMS world is materialized views. Look into these videos for more information on denormalization and data modeling the Cassandra way. C* Summit 2013: The World's Next Top Data Model - YouTube [this video] The Weather Channel: CQL (Cassandra Query Lan
Cites Zanson · 2013-08 · Stack Overflow · on “how to perform "not in" filter in cql3 query select?”
"not in" is not a supported operation in CQL. Cassandra at its heart is still based on key indexed rows. So that query is basically the same as "select * from users", as you have to go through every row and figure out if it does not match the in. If you want to do that type of query you will want to setup a map reduce job to perform it. When using Cassandra what you actually want to do is de-normalize your data model so that the queries you application performs end up querying a single partition (or just a few partitions) for their results. Also find some great webinars and talks on Cassandra data modeling [LINK] [LINK] [this video]
Cites S Kr · 2013-10 · Stack Overflow · on “Understanding Cassandra Composite keys”
I just watched this youtube video of Patrick McFadin [this video] on cassandra datamodelling. There was one table, as follows: create table user_activity_history { username varchar, interaction_date varchar, activity_code varchar, detail varchar, PRIMARY KEY((username,interaction_date),interaction_time) ); Why is the primary key ((username,interaction_date),interaction_time) . How is that different from (username,interaction_date,interaction_time) .