9

Recently read couple of Graph DB tutorials. Most of them tell what is Graph DB/when to use/fetch syntax but no where found high level description how GraphDB stores the data internally to understand it better.

Coming from java background, I think GraphDB must be storing the data similarly like Java represents the Object graph. For example Department contains the list of employees. Each department has its own address.

Department {

List<Employees> employees;
Address address;
}

When I try to think it in terms of Graph DB, Department will be a node which contains the list of memory location of its employees.

Advantages :-

Consistency :- Whenever there is an update in employee node, it does not need any update in department node as it just contains memory location of employee.

Traversal performance :- Fetching the employees for department is easy as it contains employee references. So, no need to use joins and indexes.

Is this how graph DB stores the data at high level or we can conceptualize its storage model to understand it better ?

Ashraf.Shk786
  • 154
  • 1
  • 10
user3198603
  • 1,896
  • 2
  • 16
  • 21

2 Answers2

1

The answer is dependent on the Graph store, that you're using.

Virtuoso explains its hybrid approach in a whitepaper

Other vendors use for example a turtle representation on disk and proprietary memory representations (read, we don't know how they do it).

If you're really interested, see Apache Jena's TDB implementation and its source code.

Grimaldi
  • 244
  • 1
  • 3
0

A database that uses graph structures for semantic queries with nodes, edges and properties to represent and store data is known as GRAPH DATABASE. A key concept of the system is the graph (or edge or relationship), which directly relates data items in the store. The relationships allow data in the store to be linked together directly, and in many cases retrieved with one operation.

This contrasts with conventional relational databases, where links between data are stored in the data, and queries search for this data within the store and use the join concept to collect the related data. Graph databases, by design, allow simple and fast retrieval of complex hierarchical structures that are difficult to model in relational systems.

It is written on top of JVM and possess Compact storage and Memory caching for graphs, resulting in efficient scale-up and billions of nodes in one database on moderate hardware.

You can visit this link to get a more clearer view : https://neo4j.com/developer/graph-database/

Ashraf.Shk786
  • 154
  • 1
  • 10
  • 1
    Although your linked article is good at explaining the conceptual constructs of a graph, I don't think it actually answers the question: how does a graph database store the data? The article explains how data are related and described, but not how they are stored. Eg) "a graph database stores connections alongside the data in the model" - so? In a database record I store a foreign key value right alongside the entity's property values in the same record. So what's different in the graph db? – youcantryreachingme Aug 27 '19 at 05:49
  • 1
    Eg2) "Accessing nodes and relationships in a native graph database is an efficient, constant-time operation and allows you to quickly traverse millions of connections per second per core." - yes, but *why* do graph dbs excel at this, over and above relational dbs? How, exactly, are they implemented to facilitate this performance? – youcantryreachingme Aug 27 '19 at 05:50