3
votes

I read about graphs in How to store documents in an ArangoDb graph using ArangoJs?

Now I have the following use case: I have a backend using ArangoDb and have 2 ordinary collections for USER and LOCATION. Now I want to implement a "rating" of a location from a users perspective.

So I thought it would be a good idea to design this via graphs. As far as I understand I have to create a graph and use an edge collection to save it.

What I don't understand is the difference between ordinary collections and vertex collections. Of course I would like to have the graph "managed" -> means when I remove the location or the user also the "edge" should be removed.

How can I achieve this based on my current infrastructure. (in the referenced stackoverflow question the example is using already "vertex" collections)

TIA

1

1 Answers

4
votes

There is no difference between a vertex collection and a normal collection. It is called a vertex collection when the collection is part of a graph and a normal collection when it is not.

In the reference question you provided the poster shows two examples of creating the users collection. You can either use the normal api and create a normal collection or you can use the graph API and make the collection a part of the graph.

Structurally they are the same. The difference is whether they are a part of a graph (vertex) or not (normal).