NoSQL Databases 00:00:01 Orders can look like nested documents A store adds a gift note to some orders and a shipping window to others. A document model can keep related fields together and support secondary indexes. Flexibility moves responsibility for shape and migration into explicit application or database validation. Alice is stored as one document with two fields. No table was declared. Bob has a city as well. Nothing had to change first. Ages above 25: both match. Unlike a plain key-value store, this one sees inside. Without an index the query reads the collection. With one it reads a sorted list of ages. Choose embedding from data that is read and updated together. A document that can grow forever eventually collides with size or contention limits. 00:00:54 A session token asks one exact question For a session lookup the service already knows the key. It needs the associated value or an absent result. A key-value model fits because the important access pattern is narrow and explicit. The value Alice is stored under the key user:1. The same name brings the value back, with no search. There is no user:2, so the answer is empty. That is an answer, not an error. A miss can mean that an entry expired, was evicted or never existed. Define what the application should do and whether another source is authoritative before returning an answer. 00:01:34 A sensor requires a time slice A wide-column design can place one sensor's readings together and order them by time within a partition. An efficient range request follows the selected partition and clustering keys. Alice's events arrive as 30 then 10. Inside the partition they are kept sorted. Bob's events live in another partition, perhaps on another machine. Alice after time 10: go to one partition, start in the sorted order, read on. All view events, with no user: every partition on every machine must be read. A different question, such as the hottest reading across every sensor, may need another projection. A schema aligned to one query does not automatically support every other query cheaply. 00:02:23 Relationships become the retrieval path A recommendation asks for a connection several hops away. A graph represents edges as first-class relationships and can start from a selective node before following the relevant link types. Alice is one node. Alice knows Bob and Cy. Each KNOWS is stored as its own record. From Alice, follow KNOWS once: Bob and Cy. Follow once more: Di through Bob and Cy, and Eli through Cy. The cost depends on local branching and the allowed path length. A dense intermediary can dominate a traversal even when the entire graph fits comfortably on the cluster. 00:03:05 Adding servers cannot divide a single hot key A date alone can place all of today's readings on the same logical partition. Extra workers elsewhere sit idle while that owner fills. Change the identity of the partition only after considering the questions it must answer. Every device writes to today's partition on Node A. B and C idle. One key lives in one place. A fourth node would idle as well. Millions of keys spread by hash. Each node takes about a third. The useful choice is between concrete data models, access paths, consistency promises and failure behavior. A broad SQL or NoSQL label cannot make that decision for the store.