Please enable JavaScript.
Coggle requires JavaScript to display documents.
Design Patterns of DB`s - Coggle Diagram
Design Patterns of DB`s
Graph
diagram of “dots” (called nodes or vertices) and “lines” (edges) that model some kind of “flow” or relationship
-
-
Tree
-
Properties
-
-
-
-
when an edge (a, b) is deleted, the result is a forest of two disjointed trees
Hierarchy
-
Properties
-
Inheritance
most important property of a hierarchy
If I delete an edge in a tree, I now have two separate trees
-
-
Nested Sets
we can model a tree with left and right nested sets with number pairs. These number pairs will always contain the pairs of their subordinates
Data Manipulation
adding and editing are extremely costly procedures(recalculating of the ID, restating fields)
-
selection is the purpose of this model. You can simply calculate ID, direct and indirect, of elements
Materialized Path
method for representing hierarchies in SQL stores the path from the root to each node as a string at that node
Data Manipulation
adding and editing are difficult ( get parent’s path and add to it your ID / recalculate ID of all children)
-
selection is the strength of this pattern (very convenient to use this pattern for the construction in various directories without a lot of recursive calls)