Question

Lets say we mimic the behaviour of a many-to-many relationship between Users and UserGroups, and we're storing the ID's of which UserGroups a User is in, in the User document within an array. Now when i delete a UserGroup then the ID of that UserGroup will still be in the Array in the User document - does it affect the perfomance at any point, that it's holding some old and useless values in the array?

Was it helpful?

Solution 2

I've come to the conclusion that a Document-oriented database isnt made for relationships. I've instead decided to use a object-oriented database instead (db4o).

OTHER TIPS

It certainly wouldn't affect the performance in any way, since it's just data lying there.

If it would be included in an Map/Reduce index that depends on that the relationship is fulfilled, maybe that could cause an effect. But on the other hand, if that would be the case, you would get instant feedback on that since the index would be marked as faulty.

Out of curiosity, how do you store the related IDs? Do you store them as a complete key or just the key, if you know what I mean? I've seen Ayende use the complete key approach, but I don't know which approach is the best.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top