I have a TON of arangodb questions

681 views
Skip to first unread message

dirtdevil

unread,
Dec 17, 2014, 4:41:36 PM12/17/14
to aran...@googlegroups.com
I'm new to arangodb and even newer to graphdbs. I've been using arangodb for the last month as well as watched a lot of the youtube videos on it and graph db theory. I have a ton of questions that I hope the group could help me out with. I thing graph db technology is amazing and solves a lot of the sql headaches I'm going through now.

ARANGODB
* Can a traverser only traverse through a graph and not collection to collection?
* do you know of any design patterns that can capture historical changes to vertices as well there association to edges? Being able to track vertex changes is built in but being able to track there relations isn't
* can I query a collection from inside a graph thats not marked as an edge or vertex for that graph? i.e. being able to add docs from collections outside the graph to the result set.
* are there any built in time functions that arrangodb provides that go above and beyond time formatting? if not, can I use a third party js lib like momentjs? I have a db that does a lot of time zone related calculations and time window calculations i.e. 9am-5pm window instead of a full day.
* is there any way to generate a diagram in the graph viewer of a traversers path through a graph? It would be great to traverse a graph and see a visual diagram of what paths it used.

GRAPH TECHNOLOGY
* besides finding relationship patterns between two items, are there any other benefits to a graph database?
* are there any use cases that graph dbs are good for over RDBMs for spacial queries? I've seen some info about graph maps being perfect for spatially distributed vertices like cell phone towers or traffic lights but none of them go into why or give detailed examples

TRAVERSAL
* can a traverser be used/created via api? I checked the api docs in the web interface of my arangodb instance and I didn't find a url for it
* can I do a pre/post event handling i.e. listening for events the traveler emits as it traverses the graph? Or should that functionality be performed outside of the db?
* whats the difference between a traverser and a traveler?
* do travelers support mutl-core? Or can you execute a traveler on a separate cpu core and have them run without stepping on each others traversal?
* what is the advantage of using AQL over a query
* are there any good graph db design resources you can recommend? Most of the resources I've seen where specific to neo4j and not graph db design in general or best practices
* do travelers cache commonly traversed paths on the backend? Is there a way to speed up travelers that travelers edges/vertices that rarely change yet are commonly used?
* can I "inject" logic into the traveler that populates vertexes with documents in a separate collection outside of the graph (add pseudo code)
* can I start a traversal from more then 1 vertex or a collection of edges with certain attributes?
* is it safe to assume that a traveler is like a navigable RDBM cursor? If so, how is it different from a cursor in arangodb?

MY PROJECT
* I'm working on a project with a nodejs backend and an angularjs frontend with arangodb. Are there any good nodejs model frameworks you suggest that compliment arangodb? There are a lot of model frameworks for nodejs but most of them are designed around relational dbs ORM, not graph dbs ODM. I know there is a driver for arangodb in nodejs, but I'm looking for more feature rich framework to add a lot of structure to my app. something like the graph equivalent to backbonejs
* could I possibly extend the arangodb driver to be an ODM with event handling so when a vertex changes, events can traverse it's paths to other vertices.
* how should app logs be handled? I plan on having a collection for log entries for things like user activities. I know this collection is going to get very large. Should I add relationships to it or just stamp the ids of all the things it touches. Using relationships would be great for reporting (which I know people will use) but I'm concerned about any performance impact it might have.

-thanks

Frank Celler

unread,
Dec 18, 2014, 5:56:53 PM12/18/14
to aran...@googlegroups.com


Am Mittwoch, 17. Dezember 2014 22:41:36 UTC+1 schrieb dirtdevil:
I'm new to arangodb and even newer to graphdbs. I've been using arangodb for the last month as well as watched a lot of the youtube videos on it and graph db theory. I have a ton of questions that I hope the group could help me out with. I thing graph db technology is amazing and solves a lot of the sql headaches I'm going through now.

ARANGODB
* Can a traverser only traverse through a graph and not collection to collection?

A traversal always uses a graph. A graph can contain many collections, both vertices and edges collections. You start with one vertex and follow its edges. See https://docs.arangodb.com/Foxx/README.html
 
* do you know of any design patterns that can capture historical changes to vertices as well there association to edges? Being able to track vertex changes is built in but being able to track there relations isn't

Unfortunately, there is no support in ArangoDB for this. You need to program it.
 
* can I query a collection from inside a graph thats not marked as an edge or vertex for that graph? i.e. being able to add docs from collections outside the graph to the result set.

Yes. But you need to open a transaction before starting the traversal.
 
* are there any built in time functions that arrangodb provides that go above and beyond time formatting? if not, can I use a third party js lib like momentjs? I have a db that does a lot of time zone related calculations and time window calculations i.e. 9am-5pm window instead of a full day.

You can try, if momentis can be used. Some node modules work.
 
* is there any way to generate a diagram in the graph viewer of a traversers path through a graph? It would be great to traverse a graph and see a visual diagram of what paths it used.


You could record the traversal and use some external program.
 
GRAPH TECHNOLOGY
* besides finding relationship patterns between two items, are there any other benefits to a graph database?
* are there any use cases that graph dbs are good for over RDBMs for spacial queries? I've seen some info about graph maps being perfect for spatially distributed vertices like cell phone towers or traffic lights but none of them go into why or give detailed examples

TRAVERSAL
* can a traverser be used/created via api? I checked the api docs in the web interface of my arangodb instance and I didn't find a url for it
* can I do a pre/post event handling i.e. listening for events the traveler emits as it traverses the graph? Or should that functionality be performed outside of the db?

In principle yes, but this depends on the use-case.
 
* whats the difference between a traverser and a traveler?

There should be none
 
* do travelers support mutl-core? Or can you execute a traveler on a separate cpu core and have them run without stepping on each others traversal?

Traversal can be run in parallel.
 
* what is the advantage of using AQL over a query

AQL is the query language of ArangoDB
 
* are there any good graph db design resources you can recommend? Most of the resources I've seen where specific to neo4j and not graph db design in general or best practices
* do travelers cache commonly traversed paths on the backend? Is there a way to speed up travelers that travelers edges/vertices that rarely change yet are commonly used?

No, there is no cache

* can I "inject" logic into the traveler that populates vertexes with documents in a separate collection outside of the graph (add pseudo code)

Yes
 
* can I start a traversal from more then 1 vertex or a collection of edges with certain attributes?

With a bit of tweaking it should be possible.
 
* is it safe to assume that a traveler is like a navigable RDBM cursor? If so, how is it different from a cursor in arangodb?

You can use transactions
 

MY PROJECT
* I'm working on a project with a nodejs backend and an angularjs frontend with arangodb. Are there any good nodejs model frameworks you suggest that compliment arangodb? There are a lot of model frameworks for nodejs but most of them are designed around relational dbs ORM, not graph dbs ODM. I know there is a driver for arangodb in nodejs, but I'm looking for more feature rich framework to add a lot of structure to my app. something like the graph equivalent to backbonejs

There will be a new JavaScript driver soon. But it also concentrates on the DB handling.
 
* could I possibly extend the arangodb driver to be an ODM with event handling so when a vertex changes, events can traverse it's paths to other vertices.

In principle you can use queues.
 

CoDEmanX

unread,
Dec 18, 2014, 7:40:19 PM12/18/14
to aran...@googlegroups.com
ARANGODB
* Can a traverser only traverse through a graph and not collection to collection?
ArangoDB is essentially a document store with two types of collections, vertex and edge collections. Both actually store documents, the only difference is that documents in an edge collection have a _to and a _from property, which point to documents in vertex collections and have indexes set on them. It's like a document + an arrow connecting two other documents.
 
* do you know of any design patterns that can capture historical changes to vertices as well there association to edges? Being able to track vertex changes is built in but being able to track there relations isn't
There's MVCC, but that is not to be confused with keeping a history of former vertex versions. Revisions created by MVCC are deleted at some point (except the latest version of a document of course). Version control of connections is very difficult if you wanna allow partial rollbacks, or even mathematically impossible (there's a question regarding this somewhere on stackexchange).
 
* are there any built in time functions that arrangodb provides that go above and beyond time formatting? if not, can I use a third party js lib like momentjs? I have a db that does a lot of time zone related calculations and time window calculations i.e. 9am-5pm window instead of a full day.
Sounds like a UI matter, so actually something to be done on client side, not the server / to the data model. But yes, every JS library that runs in a browser will also work in ArangoDB (as long as it doesn't use any ES6/7 features not yet available in ArangoDB's V8 engine).
 
GRAPH TECHNOLOGY
* besides finding relationship patterns between two items, are there any other benefits to a graph database?
* are there any use cases that graph dbs are good for over RDBMs for spacial queries? I've seen some info about graph maps being perfect for spatially distributed vertices like cell phone towers or traffic lights but none of them go into why or give detailed examples
It depends... if you store vertices for continents, countries, states, regions, counties etc., maybe (by basically avoiding actual spatial computations and rather traversing geographic areas semantically). In terms of performance, it fully depends on the implementation (like what index types are used).
 

TRAVERSAL
* can I do a pre/post event handling i.e. listening for events the traveler emits as it traverses the graph? Or should that functionality be performed outside of the db?
Make sure you have a look at Pregel: https://www.arangodb.com/2014/11/18/intro-pregel-module
 
* are there any good graph db design resources you can recommend? Most of the resources I've seen where specific to neo4j and not graph db design in general or best practices
Most books I encountered so far had a very strong focus on social networks. There are also a few graph-theoretical ones, but haven't found any best practice data modeling books specifically for graph dbs so far.
 
* do travelers cache commonly traversed paths on the backend? Is there a way to speed up travelers that travelers edges/vertices that rarely change yet are commonly used?
No, but vertex-centric indices are on the roadmap: https://www.arangodb.com/roadmap
 
* is it safe to assume that a traveler is like a navigable RDBM cursor? If so, how is it different from a cursor in arangodb?
Not sure what you mean by RDBM cursor. Are you talking about a result set cursor in a relational database management system like MySQL?
 

MY PROJECT
* I'm working on a project with a nodejs backend and an angularjs frontend with arangodb. Are there any good nodejs model frameworks you suggest that compliment arangodb? There are a lot of model frameworks for nodejs but most of them are designed around relational dbs ORM, not graph dbs ODM. I know there is a driver for arangodb in nodejs, but I'm looking for more feature rich framework to add a lot of structure to my app. something like the graph equivalent to backbonejs
Since vertices and edges are JSON documents, do you really need an ODM? Isn't joi sufficient to ensure proper structure?
 
* could I possibly extend the arangodb driver to be an ODM with event handling so when a vertex changes, events can traverse it's paths to other vertices.
Did you read up on custom Actions and Foxx? That's probably the way to go, the rest should be up the client.
 
* how should app logs be handled? I plan on having a collection for log entries for things like user activities. I know this collection is going to get very large. Should I add relationships to it or just stamp the ids of all the things it touches. Using relationships would be great for reporting (which I know people will use) but I'm concerned about any performance impact it might have.
 Insertion speed shouldn't be a concern with ArangoDB, and retrieval should be fast as long as you use a proper index. Make sure you read about capped collections, although there is TTL type yet (can be done on application level still).
 
Message has been deleted

Max Harper

unread,
Dec 20, 2014, 4:57:24 PM12/20/14
to aran...@googlegroups.com
* do you know of any design patterns that can capture historical changes to vertices as well there association to edges? Being able to track vertex changes is built in but being able to track there relations isn't

Unfortunately, there is no support in ArangoDB for this. You need to program it.

Thats what I mean't. A design pattern that I can program out side of arangodb. A logical way to track/fetch historical changes to vertices and edges and a way to structure vertices and edges. For example, cakephp uses an ORM pattern to "wrap" RDBM records in models and there lookup tables into relations between those models. 

My end goal is to be able to track vertices and there relationships via edge versions as well. With a data/time and a vertex, I want to traverse a grid to show all it's relations recursively. I also want to be able to generate a report based on a time range and have an option to use the historical versions of those vertices as well as showing vertices that currently don't exist but did exist in that time range. For example, I would generate a report from 2 years ago over a 6 month date range on products in a store. The report should show the products in that time frame, but also have the ability to show deleted products at that time as well as the historical attributes of those products in that time range.

The code that handles the queries can be done at a higher level in nodejs foxx or something else. But it's the graph design that I'm trying to wrap my mind around to satisfy this use case. I don't want to dump historical versions of my vertices and edges in production collections because that would be very storage heavy and the data would only be used for reports. I was thinking of keeping current versioned data in production collections and historical changes in "historical" collections on a separate server. I could use the _rev as an index along with the primary id of the document. To track date/time ranges I could add a timestamp for each edge and vertices and traverse the graph based on that.

Any thoughts?


p.s. Thank you for the youtube video. It's a bit over my head but it was full of great info. I'm googling the subjects he was talking about now. If you have any more videos like this please, send them.

-Thanks

--
You received this message because you are subscribed to a topic in the Google Groups "ArangoDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/arangodb/Jb_9oEj4zJI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to arangodb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Max Harper

unread,
Dec 20, 2014, 5:18:22 PM12/20/14
to aran...@googlegroups.com
* I'm working on a project with a nodejs backend and an angularjs frontend with arangodb. Are there any good nodejs model frameworks you suggest that compliment arangodb? There are a lot of model frameworks for nodejs but most of them are designed around relational dbs ORM, not graph dbs ODM. I know there is a driver for arangodb in nodejs, but I'm looking for more feature rich framework to add a lot of structure to my app. something like the graph equivalent to backbonejs
Since vertices and edges are JSON documents, do you really need an ODM? Isn't joi sufficient to ensure proper structure?

I don't know. I'm looking for a clean way of traversing a selected vertex. For example, in backbonejs with the supermodel plugin, I could fetch all the products in a customers shopping cart via customer().shoppingcart().products() and get an array of products. But backbonejs is not for graph dbs so I'm still trying to wrap my mind around the graph db way of fetching a list of items from a vertex. I looked at the nodejs driver and I like the pattern it uses to append search criteria to a query but I don't think I can use it directly to do what I want. I'm sure with a few structural adjustments, I could make it work but I'm not sure how to adjust it. Are there any pre-existing app examples where someone wraps there biz objects in js with a graphdb backend? I could use that as an example to go off of.

-Thanks



--

florian

unread,
Dec 29, 2014, 8:56:48 AM12/29/14
to aran...@googlegroups.com
Hi,

If you use the ArangoDBs nodejs driver you could do the following :

//Define a graph that matches your example
var edgeDefinitions = [

   
{
      collection
: "shoppingcart",
     
from: ["customer"],
      to
: ["products"]
   
}
];


db
.graph.create("yourGraph", edgeDefinitions, someCallBackFunction);



Now you can use either the method  getNeighbourVertices to solve your problem ....

db.graph.getNeighbourVertices("yourGraph", "someCustomer", someCallBackFunction);

... or make use of the various graph aql functions documentated here :
F.e. if you want to use the GRAPH_NEIGHBORS function it would like this: 

var cursorData = {};
cursorData
.query = "FOR p IN GRAPH_NEIGHBORS("yourGraph", "someCustomer", {})
 FiLTER LIKE(p.key1 ,@name) RETURN p._id"
db
.cursor.create(cursorData, someCallBackFunction);

You can even use the aql language support in the nodejs driver :

db.query.for("x").in.graph_neighbors("yourGraph", "someCustomer", {}).return("x")
     
.exec()
     
.then(someCallBackFunction);



Reply all
Reply to author
Forward
0 new messages