The document describes a model-driven approach for designing graph databases. It presents a 3-step methodology: 1) generating an entity-relationship diagram, 2) partitioning the diagram elements, and 3) defining a template based on the partitions. An example application to a blog dataset is provided, showing the entity-relationship diagram, its orientation, partitioning, resulting template, and an instance of the template. Empirical results suggest the approach minimizes data accesses compared to sparse native strategies. Future work aims to incorporate more design aspects and verify the approach for other NoSQL databases.
Axa Assurance Maroc - Insurer Innovation Award 2024
Modelgraphdb
1. Model-Driven Design of
Graph Databases
Roberto De Virgilio, Antonio Maccioni and Riccardo Torlone
33rd edition of the International Conference on Conceptual Modeling (ER2014) – Atlanta, GA (U.S.A.)
2. Context (Theory)
Semantics
Meta- Models
Logics
Concepts
ER
Models
NoSPARQL
Schema-free
Agile
Development
NoDB
NoSQL
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
3. Context (Practice)
Software engineers still reason at different
abstraction levels
Data engineers still model
their databases
We cannot give up
modeling with all
NoSQLs
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
4. Graph Databases
admin
belongs
works
belongs
admin
likes
friend
married
follows
belongs
friend
belongs
worked
likes
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
5. Property Graph Model
n1 n2
Uname: Date
Uid: u01
Bname: Database
Bid: b02
label: follower
label: admin
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
6. Graph DB Modeling: How?
Compact: Sparse: Dense:
Reduces the
Accesses and
number of data
updates can be
accesses
inefficient
Can violate
property graph
constraints
Reduces
number of joins
Needs human
intervention for
a semantic
enrichment
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
7. Our 3-steps Approach
1) Generation of an oriented ER diagram
2) Partitioning of the elements (entities and
relationships) of the obtained diagram
3) Definition of a template over the resulting
partition.
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
8. Use case: ER
Category
(0:N)
url eid description
External about
ctid
uid (0:N) (1:1)
admin
(1:1)
contains Link
(1:1) (0:N)
post
cid
date
date
(1:1)
Comment User Blog
follower
tag
(0:N) (0:N)
(0:N) (0:N)
uname
(1:1)
bid
bname
msg
(1:1) (0:N)
publish
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
9. Orienting the ER
ENTITY 1
(0:1)
RELATIONSHIP
(0:1)
ENTITY 2
ENTITY 1
RELATIONSHIP : 0
ENTITY 2
ENTITY 1
(0:N)
RELATIONSHIP
(0:1)
ENTITY 2
ENTITY 1
RELATIONSHIP : 1
ENTITY 2
ENTITY 1
(0:N)
RELATIONSHIP
(0:N)
ENTITY 2
ENTITY 1
RELATIONSHIP : 2
ENTITY 2
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
10. Use case: O-ER
post:1
admin:1
contains:0 about:1
External
Link Comment User Blog
Category
tag:2
publish:1
follower:2
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
11. Partitioning the O-ER
Rule 1: if a node n is disconnected
then it forms a group by itself.
Rule 2: if a node n has w−(n)>1 and w+(n)>0 then n
forms a group by itself.
Rule 3: if a node n has w−(n)<2 and w+(n)<2 then n
is added to the group of a node m such that there
exists the edge (m, n) in the O-ER diagram.
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
12. Use case: partitioned O-ER
post:1
admin:1
contains:0 about:1
External
Link Comment User Blog
Category
tag:2
publish:1
follower:2
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
13. Template of the Graph Database
A template describes homogeneous nodes
occurring in a graph database and the ways
they are connected.
A template is derived by
grouping together attributes
of nodes in the partitioning.
A template is similar to a logical schema, but
it is not a schema!
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
14. Use case: the Template
ExternalLink.eid
ExternalLink.url
Comment.cid
Comment.msg
User.uid
User.uname
Blog.bid
Blog.bname
Category.ctid
Category.description
date
label
label
label
label
label
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
15. Use case: an instance
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
16. Empirical Results
sparse native strategy
our approach
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014
17. Conclusion and Future Work
Conceptual modeling of graph databases
is useful and possible
Our methodology is system
independent and aim at minimizing
data accesses
We want to involve more aspects in the design process
and verify the approach with other NoSQL
We are developing a tool that allows the developer to
customize the modeling of this methodology by tuning
on the parameters
ER 2014 Model-Driven Design of Graph Databases Atlanta, USA, 28th Oct 2014