Demo: the same data in four models
On This Lesson 3 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
model Shop reviews four ways and compare the queries each supports. Prepares MID-041-LAB1.
Draft outline details
Step by step
- Relational: tables
review,product,customer; show the join for "latest 20 with customer name". - Document: one review per document, with the customer name copied in; show a find by
productIdsorted by date. - Wide-column:
reviews_by_productandreviews_by_customertables; show the duplicated writes. - Graph:
(Customer)-[:WROTE]->(Review)-[:ABOUT]->(Product); show a "similar reviewers" traversal. - Planned mistake: copy the relational schema into the document store with references everywhere; every read needs several lookups. Fix: embed what is read together (customer display name, rating).
- Fill the comparison table of queries each model supports well.
Check your understanding
Which model best answers "latest reviews of a product" at huge write volume?
Show answer
Wide-column, partitioned by product.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.