Skip to content
Ameen Abozaid
Planned lessonMID-041-L06

Demo: the same data in four models

  • Lesson 6 of 6
  • Mid-level
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

  1. Relational: tables review, product, customer; show the join for "latest 20 with customer name".
  2. Document: one review per document, with the customer name copied in; show a find by productId sorted by date.
  3. Wide-column: reviews_by_product and reviews_by_customer tables; show the duplicated writes.
  4. Graph: (Customer)-[:WROTE]->(Review)-[:ABOUT]->(Product); show a "similar reviewers" traversal.
  5. 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).
  6. 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.