
1. Relational
- SQL - Codd in 1970.
- The Birth of NoSQL in the 2010s (more scalability, spec query ops, less restrictiveness)
- The Object-Relational Mismatch → relational tables to OO languages (impedance mismatch). ActiveRecord, Hibernate, or EFCore is used.
- Many-to-One and Many-to-Many Relationships. An example of a LinkedIn profile and how to add recommendations.
- Relational vs. Document DBs today. Document databases offer schema flexibility and improved performance. They also lead to simpler app code, but they have limitations. For example, you cannot refer directly to a nested item in the list of positions for user 251, and there are no joins.

2. Document DB
- MongoDB, RethinkDB, CouchDB, Espresso (can store JSON)
- They are not schemaless; they have schema-on-read (implicit data structure, interpreted when data is read). Similar to dynamic (runtime) type checking in prog. Languages, while schema-on-write, are identical to static (compile-time) type checking.
- Data locality → Keep documents small and avoid writing that increases their size.
- Converge of Document and SQL Dbs → Support for JSON in SQL Dbs
3. Declarative queries on the web
- CSS selectors
- XPath for XLS
- MapReduce Querying (Google): between imperative and declarative languages. Based on the map (collect) and reduce (fold or inject) functions. The problem is that you must write two carefully coordinated JS functions, which is harder than one query.
4. Graph
- When many-to-many relationships are prevalent in data, model the data as a graph.
- Property-graph model (impl by Neo4j, Titan, InfinitedGraph)
- Each vertex has: a unique identifier, a set of outgoing and incoming edges, and a collection of properties
- Each edge has a unique identifier and a vertex at which the edge starts, a vertex at which the edge ends, a label to describe the kind of relationship between two vertice,s and a collection of properties
- Neo4j created the Cypher Query Language.