Hi Scott a link is a unidirectional reference, so it cannot be used for backward traversal. If you need bi-directional traversal you have two alternatives: - create and maintain two links (from A to B and from B to A) - use edges (Graph API)
Just consider that: - an edge, under the hood, is nothing but a document with bi-directional links to vertices - as long as you use Graph API, edges are maintained consistent by OrientDB, so you do not have to deal with it manually - graph and document API can be used and mixed together, in SQL and in Java API (graph API follows some particular conventions on field names, and you have to know them to use your links as if they were edges) - there is no difference between edges and links in terms of performance In the end, if you need bi-directional relationships, I suggest you to use edges. If you need any other info or you have any other question, please do not hesitate to ask thanks Luigi 2015-05-08 17:44 GMT+02:00 Scott Orr <[email protected]>: > My team is setting up a database for an analytical layer of a website. > Our goal is to store large amounts of data related to our users and > inventory, such as information on browsing sessions, user feedback, tweets > and Facebook posts, etc. We want to be able to use that information to > make recommendations to users in real time (e.g., Amazon-type stuff, like > "Other people who viewed this item also viewed...."). > > We're using Orient 2.0.8. > > From looking at the Orient wiki and the questions answered on this and > other groups, we think we need to be using LINKLISTs for part of our > application. For example, we'd like to be able to store tweets about each > of the 20,000 items in our inventory. Ideally, the record for each item > would include links to each of those tweets, which could number in the tens > of thousands--and a LINKLIST seems like the obvious way to bundle all of > those links into a single property, with the added bonus that a LINKLIST is > ordered, which means that, among other things, we could pop the last 10 or > so tweets about a given item, and display those on the page describing that > item's details. > > My first question is, can a LINKLIST be used with bidirectional edges (I > assume they'd be lightweight edges)? We need to be able to traverse the > links in both directions. > > If LINKLISTs must consist only of unidirectional links, we'll have to > create links at end end of each pair (so, a LINKLIST pointing out of an > inventory item, to all of its related tweets, and a link from each tweet > back to that item). If we have to do this, can we still use the Graph API > to traverse those links, and if not, is link traversal any slower with the > Document API? > > > Thanks. > > -- > > --- > You received this message because you are subscribed to the Google Groups > "OrientDB" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
