Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AangoDB: Ghrarial interface Vs Edges/Documents

What is the difference between edges/documents created independently and those created using gharial's interface?

like image 215
tariqdaouda Avatar asked Oct 29 '14 13:10

tariqdaouda


1 Answers

Edges/Documents created through the normal collection API do not know anything of each other, especially if you save an edge it is not checked if their source and target vertices exist, it is just verified that the collections are valid.

If you save documents/edges using the gharial or general-graph module (which is the module gharial uses) you get guarantees over your graph. This includes the following:

  • Saving edges verifies that source and target vertices exist and are valid (fitting to the underlying relation definition)
  • Deleting an vertex triggers a cascade to delete all connected edges known to any graph.

This gives the benefit that you do not have loose ends or orphan edges in your graph which is often required.

The internal storage of edges remains untouched by gharial, so if you save an edge with gharial you could access it with normal document API and vice versa. However only saving through gharial gives above mentioned guarantees.

like image 62
mchacki Avatar answered Sep 23 '22 23:09

mchacki