I'm new to the world of non-relational databases, and am struggling a bit with making a proper schema for handling social relationships (like Friendships). In a relational database, like MySQL, I'd do something like this:
from_user : user foreign_key
to_user : user foreign_key
status: 0, 1, 2 // 0 = sent, 1 = accepted, 2 = rejected
I'd then query this table to determine a list of friends associated with a particular user.
But with a non-relational database, I imagine that this type of schema isn't ideal. Instead, I'm wondering what approaches people have for dealing with this in Mongo. Should I have embedded docs in each User for 'sent-requests', 'received-requests', and 'friends'? The maintenance for this might be high for sending requests, creating friendships, and deleting them, but retrieving the friendships would be fairly easy.
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb