Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ArangoDB: (1 Graph with several Edge Definition) Vs (1 Edge Definition per Graph)

I was wondering if there is any advantage to having several edges definition in one single graph Vs having several graphs each one with a single edge definition.

Thanks for you help,

like image 942
tariqdaouda Avatar asked Oct 29 '14 23:10

tariqdaouda


People also ask

What is an edge collection in ArangoDB?

For other languages see the corresponding language API. A graph data model always consists of at least two collections: the relations between the nodes in the graphs are stored in an “edges collection”, the nodes in the graph are stored in documents in regular collections. Edges in ArangoDB are special documents.

What is a graph data model in ArangoDB?

A graph data model always consists of at least two collections: the relations between the nodes in the graphs are stored in an “edges collection”, the nodes in the graph are stored in documents in regular collections. Edges in ArangoDB are special documents.

How to replace edges in ArangoDB graph?

In order to replace edges in the graph you at least need to have the following privileges: Read Only access on the Database. Write access on the given collection. error: Flag if there was an error (true) or not (false). It is true in this response. code: The response code. errorNum: ArangoDB error number for the error that occurred.

What is the difference between old and New in ArangoDB?

new: The complete newly written edge document. Includes all written attributes in the request body and all internal attributes generated by ArangoDB. Will only be present if returnNew is true. old: The complete overwritten edge document. Includes all attributes stored before this operation.


1 Answers

There are different reasons for using multiple edge definitions instead of only one:

  1. To show differences in content: You may want to have different edge collections for bought and watched. This is also possible by using a label however and comes down to personal preference.
  2. Edge definitions allow you to restrict the collections on the in and on the out side of the edges. So you can for example say that your bought transitions always start in a document for the people collection and go to the product collection. You would otherwise need to do that inside of your application.
like image 186
moonglum Avatar answered Sep 28 '22 12:09

moonglum