Book: Designing Data Intensive Applications
Chapter: Data Models and Query Languages
Summary:
Data Models
This chapter talks about data models and query languages. It starts off by comparing the traditional relational model with other data models including the network model and document databases.
The chapter goes deeper in exploring modern document databases in more detail, namely:
Schema flexibility
Does not enforce any schema on data in the DB
schema-on-read rather than schema-on-write
Data locality for queries
Advantage when large parts of the document is needed at the same time
Convergence of document and relational databases
Relational databases are moving towards support for XML and JSON today
Document databases like RethinkDB and MongoDB has some level of support for joins
Allows them to complement each other
Query Languages
Query languages like SQL is a declarative query language which brings these benefits:
Abstracts away the 'how' allowing users to focus on the pattern of data that they want
Concise and easier to work with
Allows improvements in what happens behind the scenes without affecting how the user queries data
Graph-Like Data Models
Graph-Like Data Models are suitable for when data has many many-to-many relationships.
Typical examples include:
Social graphs
The web graph
Road/Rail networks
Property Graph Model
Vertices consist of:
Unique Identifier
Set of outgoing edges
Set of incoming edges
Collection of peoperties (key-value pairs)
Edges consist of:
Unique Identifier
Vertex of Edge Start
Vertex of edge end
Label
Collection of properties (key-value pairs)
Important properties of this model:
Any vertex can have an edge connecting it with any other vertex
Given any vertex, finding both its incoming and outgoing edges can be done efficiently
By using different lables for different kinds of relationships, several kinds of information can be stored in a single graph
Book: Designing Data Intensive Applications Chapter: Data Models and Query Languages
Summary:
Data Models
This chapter talks about data models and query languages. It starts off by comparing the traditional relational model with other data models including the network model and document databases.
The chapter goes deeper in exploring modern document databases in more detail, namely:
Query Languages
Query languages like SQL is a declarative query language which brings these benefits:
Graph-Like Data Models
Graph-Like Data Models are suitable for when data has many many-to-many relationships.
Typical examples include:
Property Graph Model
Vertices consist of:
Edges consist of:
Important properties of this model: