ORNL / DataFed

A Federated Scientific Data Management System
https://ornl.github.io/DataFed/
Other
18 stars 14 forks source link

DB - Remove need for owner edge on aliases #436

Open dvstans opened 4 years ago

dvstans commented 4 years ago

I do not think an owner edge is needed for aliases. Aliases are tied to a specific data record or collection and never need to be found by traversal from an owner directly. Removing the owner edge would reduce complexity and improve performance.

dvstans commented 4 years ago

Note: the owner edge is used when deleting projects and users; however, this can be avoided by a simple one-hop look up for data and collections.

dvstans commented 3 years ago

Note: it may be possible to remove the separate alias collection entirely - maybe adding data/collection to fully qualified alias - so only needed if there is a conflict. Or maybe some way to create a uniqueness constraint across collections in arango?

JoshuaSBrown commented 1 year ago

I don't completely follow the last comment.

Aren't aliases unique to a user? How are you enforcing the uniqueness? When creating a new alias associated with a user account it makes sense that they would be listed as an edge to either the project or user account to make it easy to enforce uniqueness, though I'm not sure I fully understand how this is currently implemented.

dvstans commented 1 year ago

Aliases are currently stored in a separate DB collection and linked to their associated data/collection. An alias is the ID field of the collection do is indexed and checked for uniqueness automatically. If aliases could be saved directly in a data record or collection, it would reduce the complexity of a lot of queries. Aliases need to be indexed and unique. I think this could be achieved by creating a new Arango index, but I need to do some research. Either way, it's only a small optimization / code clean-up.