The best-known data model today is probably that of SQL, based on the relational model proposed by Edgar Codd in 1970. In this model, data is organized into relations (called…
- 04.01Relational Versus Document ModelsThe best-known data model today is probably that of SQL, based on the relational model proposed by Edgar Codd in 1970. In this model, data is organized into relations (called…
- 04.02The Object-Relational MismatchMuch application development today is done in object-oriented programming languages, which leads to a common criticism of the SQL data model: if data is stored in relational…
- 04.03Normalization, Denormalization, and JoinsIn Example 3-1 in the preceding section, region_id is given as an ID, not as the plain-text string Washington, DC, United States. Why?
- 04.04Many-to-One and Many-to-Many RelationshipsWhile the positions and education tables in Figure 3-1 are examples of one-to-many or one-to-few relationships (one résumé has several positions, but each position belongs only…
- 04.05Stars and Snowflakes: Schemas for AnalyticsData warehouses (see “Data Warehousing”) are usually relational, and there are a few widely used conventions for the structure of tables in a data warehouse, including a star…
- 04.06When to Use Which ModelThe main arguments in favor of the document data model are schema flexibility, better performance due to locality, and that for some applications it is closer to the object…
- 04.07Graph-Like Data ModelsWe saw earlier that the type of relationships is an important distinguishing feature across data models. If your application has mostly one-to-many relationships…
- 04.08Property GraphsIn the property graph (also known as labeled property graph) model, each vertex consists of the following:
- 04.09The Cypher Query LanguageCypher is a query language for property graphs, originally created for the Neo4j graph database and later developed into an open standard as openCypher. Besides Neo4j, Cypher…
- 04.10Graph Queries in SQLExample 3-3 suggested that graph data can be represented in a relational database. But if we put graph data in a relational structure, can we also query it using SQL?
- 04.11Triple Stores and SPARQLThe triple store model is mostly equivalent to the property graph model, using different words to describe the same ideas. It is nevertheless worth discussing, because various…
- 04.12Datalog: Recursive Relational QueriesDatalog, a much older language than SPARQL or Cypher, arose from academic research in the 1980s. It is less well-known among software engineers and not widely supported in…
- 04.13GraphQLGraphQL is a query language that, by design, is much more restrictive than the others we have seen in this topic. It’s intended for OLTP queries; its purpose is to allow client…
- 04.14Event Sourcing and CQRSIn all the data models we have discussed so far, the data is queried in the same form as it is written—be it JSON documents, rows in tables, or vertices and edges in a graph.…
- 04.15DataFrames, Matrices, and ArraysThe data models we have seen so far in this topic are generally used for both transaction processing and analytics purposes (see “Operational Versus Analytical Systems”). There…
- 04.16Recap: Data Models and Query LanguagesData models are a huge subject, and in this topic we have taken a quick look at a broad variety of models. We didn’t have space to go into all the details of each model, but…