Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edge Collection vs. Graph

There's one thing I don't get in ArangoDB:

What's the difference between an edge collection and a graph? In which cases should I choose which?

like image 597
Mr.Yeah Avatar asked Jan 09 '23 22:01

Mr.Yeah


1 Answers

Graphs in ArangoDB are built on top of documents and edges.

Edge collections have automatic indexes on _from and _to, allowing efficient retrieval of any connected documents. Because data are still stored in regular (document and edge) collections, you can use these collections in non-graph queries, too.

Graphs add some functionality (i.e. query methods, traversals) on top of the data. You can have multiple of them in ArangoDB. Think of a "graph" being a means of grouping for parts or all of your data, and making them accessible in queries.

like image 106
stj Avatar answered Jan 18 '23 13:01

stj