So we would have to write into two tables if the user ever comments on a video? One for the user commented table and the other the video commented table. Would this be the best practice for a n - m relationship alternative for Cassandra @DataStax Developers
That's correct -- tables are denormalised in Cassandra so data is duplicated depending on the app queries required. If you have any follow up questions, feel free to post on stackoverflow.com/questions/ask?tags=cassandra and I'd be happy to help. 🍻 [Erick Ramirez]
Very well explained but now I'm wondering in this example, say there's a new comment generated from the UI. Would there need to be two inserts now for each table? I could see mismanagement of CRUD getting the data out of whack quite easily. Deleting and editing seem like a nightmare.. not sure if this is answered in your next video... But this is kinda terrifying.
@@DataStaxDevs I feels like putting on a snowboard for the first time after skiing for years. I guess I could write a function to handling the cascading. I need to shake the fear.
I'm having trouble understanding whether the commentid columns in this example would contain the same value per-comment. I'm assuming they would be the same, but would that mean that in this example you would generate the commentid before inserting into both of these tables? Or maybe the commentid columns are unique...
commentid will be the same in both tables for the same comment. So indeed you will create in before hand with the drivers for instance Timeuuid.docs.datastax.com/en/developer/java-driver/4.14/manual/core/temporal_types/ or in Java Uuid.timebased();
great crash course. not sure why comments are both stored in comments_by_user and comments_by_video tables. seems like data redundant to me, an anti-design pattern. furthermore, if a comment is to be updated the change must be applied to both tables.
Coming from the relational world, this video does a great job of explaining the nosql approach
This content is GOLD. Thank you for your time/effort!
So we would have to write into two tables if the user ever comments on a video? One for the user commented table and the other the video commented table. Would this be the best practice for a n - m relationship alternative for Cassandra @DataStax Developers
That's correct -- tables are denormalised in Cassandra so data is duplicated depending on the app queries required. If you have any follow up questions, feel free to post on stackoverflow.com/questions/ask?tags=cassandra and I'd be happy to help. 🍻 [Erick Ramirez]
very good explanation of essence of Kassandra data model! Finally I got it :) Put a like. Thank you!
dude, you're amazing man. Props to you.
if you know where your star schema center is and how often is going to be modified. denormalization isn't bad.
Very well explained but now I'm wondering in this example, say there's a new comment generated from the UI. Would there need to be two inserts now for each table? I could see mismanagement of CRUD getting the data out of whack quite easily. Deleting and editing seem like a nightmare.. not sure if this is answered in your next video... But this is kinda terrifying.
Correct, it will imply two writes to two different tables. It's a commonly used optimisation technique known as denormalisation.
@@DataStaxDevs I feels like putting on a snowboard for the first time after skiing for years. I guess I could write a function to handling the cascading. I need to shake the fear.
I'm having trouble understanding whether the commentid columns in this example would contain the same value per-comment. I'm assuming they would be the same, but would that mean that in this example you would generate the commentid before inserting into both of these tables? Or maybe the commentid columns are unique...
commentid will be the same in both tables for the same comment. So indeed you will create in before hand with the drivers for instance Timeuuid.docs.datastax.com/en/developer/java-driver/4.14/manual/core/temporal_types/ or in Java Uuid.timebased();
Excellent !!!
Many thanks!
Excelent! Thank you!
very helpful. thanks!
Thank you ~~~
great crash course. not sure why comments are both stored in comments_by_user and comments_by_video tables. seems like data redundant to me, an anti-design pattern. furthermore, if a comment is to be updated the change must be applied to both tables.
Thank u a lot.
First comment