Use cases for Linkset, LinkList, LinkMap

397 views
Skip to first unread message

JTCA

unread,
Apr 8, 2015, 10:27:18 PM4/8/15
to orient-...@googlegroups.com
What are the use cases for LinkSet, LinkList, and LinkMap and how are they better/worse than a Link?

Colin

unread,
Apr 8, 2015, 11:40:52 PM4/8/15
to orient-...@googlegroups.com
A Link points to a single record (Document or Vertex).

A LinkSet is a collection set of other records.  Likewise, a LinkList is a collection list of records and a LinkMap is a collection map of records.

There are also embedded versions of these where each record is actually embedded within the owner and no record id is created for the embedded record(s).

-Colin

Jeffrey Auguste

unread,
Apr 9, 2015, 10:08:06 AM4/9/15
to orient-...@googlegroups.com
Forewarning, my questions might be a bit elementary, I'm new to orientdb. 

So the cons with embedded would be that the relationship would only exist in the owner and would be lost if the owner is deleted resulting in ownerless objects and the owner objects would be larger?
The Pro would be more easier cleanup on deletions and possibly faster data retrieval?

As for the linkset(list)(map). I maybe missing an understanding. Why would you want to store a collection verses just creating additional Links. Performance gain? Am I missing a limitation of a Link that these types allow?

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/3ztJQMX-cOs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Colin

unread,
Apr 9, 2015, 10:20:33 AM4/9/15
to orient-...@googlegroups.com
Actually the pro with embedded is that the embedded record is fully deleted when the object it's embedded in is deleted.  For a record that links to another, you could have the scenario of 'ownerless' records if you deleted the owner and forgot to delete the linked object.

This is where using the graph database features of creating edges on vertices is nice because that management is handled for you and links (the edges) are bi-directional.

A link in the document interface is a single connection to another record (document).  You can only have one link with the same property name.  This is why the collections of list, map, set are useful for multiple connections.

If you have a need for many thousands or millions of links, then it's advised to use a LinkBag.

Hope that clarifies some things.

-Colin

Orient Technologies

The Company behind OrientDB

Reply all
Reply to author
Forward
0 new messages