3
votes

We were looking for the most suitable database for our innovative “collaboration application”. Sorry, we don’t know how to name it in a way generally understood. In fact, highly complicated relationships among tenants, roles, users, tasks and bills need to be handled effectively.

After reading 5 DBs(Postgrel, Mongo, Couch, Arango and Neo4J), when the words “… relationships among things are more important than things themselves” came to my eyes, I made up my mind to dig into OrientDB. Both the design philosophy and innovative features of OrientDB (multi-models, cluster, OO,native graph, full graph API, SQL-like, LiveQuery, multi-masters, auditing, simple RID and version number ...) keep intensifying my enthusiasm.

OrientDB enlightens me to re-think and try to model from a totally different viewpoint!

We are now designing the data structure based on OrientDB. However, there are some questions puzzling me.

  1. LINK vs. EDGE

Take a case that a CLIENT may place thousands of ORDERs, how to choose between LINKs and EDGEs to store the relationships? I prefer EDGEs, but they seem like to store thousands of RIDs of ORDERs in the CLIENT record.

  1. Embedded records’ Security

Can an embedded record be authorized independently from it’s container record?

  1. Record-level Security

How does activating Record-level Security affect the query performance?

Hope I express clearly. Any words will be truly appreciated.

1
Hi @Sunrise what do you mean with Embedded records’ Security? Thx in advance - Michela Bonizzi
@Michela Bonizzi "OrientDB supports two kinds of relationships: referenced and embedded. When using Embedded relationships, OrientDB stores the relationship within the record that embeds it." Take my case, embedded records may need to be authorized independently from it’s container record. - Sunrise

1 Answers

2
votes

LINK vs EDGE

If you don't have properties on your arch you can use a link, instead if you have it use edges. You really need edges if you need to traverse the relationship in both directions, while using the linklist you can only in one direction (just like a hyperlink on the web), without the overhead of edges. Edges are the right choice if you need to walk thru a graph.Edges require more storage space than a linklist. Another difference between them it's the fact that if you have two vertices linked each other through a link A --> (link) B if you delete B, the link doesn't disappear it will remain but without pointing something. It is designed this way because when you delete a document, finding all the other documents that link to it would mean doing a full scan of the database, that typically takes ages to complete. The Graph API, with bi-directional links, is specifically designed to resolve this problem, so in general we suggest customers to use that, or to be careful and manage link consistency at application level.

RECORD - LEVEL SECURITY

Using 1 Million vertex and an admin user called Luke, doing a query like: select from where title = ? with an NOT_UNIQUE_HASH_INDEX the execution time it has been 0.027 sec. OrientDB has the concept of users and roles, as well as Record Level Security. It also supports token based authentication, so it's possible to use OrientDB as your primary means of authorizing/authenticating users.

EMBEDDED RECORD'S SECURITY

I've made this example for trying to answer to your question

I have this structure:

enter image description here

If I want to access to the embedded data, I have to do this command: select prop from User

enter image description here

Because if I try to access it through the class that contains the type of car I won't have any type of result

select from Car

enter image description here

UPDATE

OrientDB supports that kind of authorization/authentication but it's a little bit different from your example. For example: if an user A, without admin permission, inserts a record, another user B can't see the record inserted by user A without admin permission. An User can see only the records that has inserted.

Hope it helps