Concept Flow - NoSQL database types (document, key-value, column, graph)
Start: Choose NoSQL type
Use case decides best fit
You pick a NoSQL type based on data structure: documents, key-value pairs, columns, or graphs.
INSERT INTO DocumentDB {"name": "Alice", "age": 30}
PUT KeyValueDB "user123" "Alice"
INSERT INTO ColumnDB (user_id, name) VALUES (123, "Alice")
CREATE NODE GraphDB (id:1, name:"Alice")
CREATE EDGE GraphDB (from:1, to:2, relation:"friend")| Step | Database Type | Operation | Data Stored | Internal Structure | Result |
|---|---|---|---|---|---|
| 1 | Document | Insert | {"name": "Alice", "age": 30} | JSON-like document | Document stored with fields name and age |
| 2 | Key-Value | Put | Key: "user123", Value: "Alice" | Simple key-value pair | Key-value pair stored |
| 3 | Column | Insert | user_id=123, name="Alice" | Columns grouped in families | Row inserted with columns |
| 4 | Graph | Create Node | Node id=1, name="Alice" | Node with properties | Node created |
| 5 | Graph | Create Edge | Edge from node 1 to 2, relation="friend" | Edge connecting nodes | Edge created linking nodes |
| 6 | - | - | - | - | Execution ends after all inserts |
| Variable | Start | After Step 1 | After Step 2 | After Step 3 | After Step 4 | After Step 5 | Final |
|---|---|---|---|---|---|---|---|
| DocumentDB | empty | {"name": "Alice", "age": 30} | {"name": "Alice", "age": 30} | {"name": "Alice", "age": 30} | {"name": "Alice", "age": 30} | {"name": "Alice", "age": 30} | {"name": "Alice", "age": 30} |
| KeyValueDB | empty | empty | {"user123": "Alice"} | {"user123": "Alice"} | {"user123": "Alice"} | {"user123": "Alice"} | {"user123": "Alice"} |
| ColumnDB | empty | empty | empty | Row with user_id=123, name="Alice" | Row with user_id=123, name="Alice" | Row with user_id=123, name="Alice" | Row with user_id=123, name="Alice" |
| GraphDB Nodes | empty | empty | empty | Node 1: {name: "Alice"} | Node 1: {name: "Alice"} | Node 1: {name: "Alice"} | Node 1: {name: "Alice"} |
| GraphDB Edges | empty | empty | empty | empty | empty | Edge from 1 to 2: {relation: "friend"} | Edge from 1 to 2: {relation: "friend"} |
NoSQL databases store data differently: - Document: JSON-like documents with fields - Key-Value: simple key and value pairs - Column: data in columns grouped by families - Graph: nodes connected by edges Choose type based on data shape and query needs.