Key-value and document stores
On This Lesson 4 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
describe the two most common models.
Planned topics
- Key-value (Redis, DynamoDB basics): fetch by key; very fast; no query by value unless you build an index.
- Document (MongoDB): JSON-like documents with nested data and flexible fields; indexes on fields; query inside the document.
- Document fits data read as a unit: a review with its comments, a product with attributes.
- Consistency: single-document writes are atomic; cross-document needs transactions or design around them.
Draft outline details
Demonstration
{ "_id": "r1", "productId": 42, "rating": 5, "text": "Great", "tags": ["fast"] }Lookup by _id is O(1) in a key-value store; querying by productId needs an index in a document store.
Check your understanding
What is a document store good at?
Show answer
Reading and writing a nested object as one unit.
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.