Open dvstans opened 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.
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?
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.
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.
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.