25

What is the difference between a Graph Database (e.g. Neo4J) and a Network Database (e.g. IDS, CODASYL)? In principle are they the same thing?

3 Answers 3

25

The network databases like CODSASYL are still more or less based on a hierarchical data model, thinking in terms of parent-child (or owner-member in CODASYL terminology) relationships. This also means that in network database you can't relate arbitrary records to each other, which makes it hard to work with graph-oriented datasets. For example, you may use a graph database to analyze what relationships exist between entities.

Also, network databases use fixed records with a predefined set of fields, while graph databases use the more flexible Property Graph Model, allowing for arbitrary key/value pairs on both nodes/vertices and relationships/edges.

3
  • 1
    Excellent answer, thanks. This is kind of what I thought too. I'm just not convinced that navigating a network between individual values or records rather than sets of similar records really makes the two fundamentally different.
    – nvogel
    Commented Feb 18, 2011 at 19:21
  • From wikipedia: en.wikipedia.org/wiki/Graph_database and en.wikipedia.org/wiki/Network_model Commented Oct 30, 2013 at 9:17
  • 1
    "a network can be defined as a graph in which nodes and/or edges have attributes" - en.wikipedia.org/wiki/Network_theory. A graph is a more abstract thing than a network. What people call graph databases may well be network databases. The reason they are not called network databases any longer could be because of the way CODSASYL fell out of favor when the relational model became popular. Commented Jan 6, 2019 at 15:50
7

Copying from the book Designing Data-Intensive Applications by Martin Kleppmann.

  1. In the network model, the database had a schema that specified which record type could be nested within which other record type. In a graph database, there is no such restriction: any vertex can have an edge to any other vertex. This gives much greater flexibility for applications to adapt to changing requirements.

  2. In the network model, the only way to reach a particular record was to traverse one of the access paths to it. In a graph database, you can refer directly to any vertex by its unique ID, or you can use an index to find vertices with a particular value.

  3. In the network model, the children of a record were an ordered set, so the database had to maintain that ordering (which had consequences for the storage layout) and applications that inserted new records into the database had to worry about the positions of the new records in these sets. In a graph database, vertices and edges are not ordered (you can only sort the results when making a query).

  4. In the network model, all queries were imperative, difficult to write and easily broken by changes in the schema. In a graph database, you can write your traversal in imperative code if you want to, but most graph databases also support high-level, declarative query languages such as Cypher or SPARQL.

1
  • This is from chapter 2 page 60, by the way. Commented Mar 8, 2020 at 20:42
3

First, let´s ask the question correctly. There are TWO types of graph databases: RD Graph (standard) and Property Graph (non-standard). Neo4J is a Property Database, not a "standard" RDF Graph.

Then, if you read Sumit Sethia´s answer above, you will have the right answer in terms of the relationship between the Network Model and the Graph DB (which, by deafult should be understood as an RDF graph).

It helps to think of the relationships as a development time-line, where next step "improves" previous step. Then it would be something like the Hierarchical DB first, then the Network Model, then Graph, and then Property Graph. This is not "strict", by the way.

Not the answer you're looking for? Browse other questions tagged or ask your own question.