开发者

Friend Relationships in a Social Network

I think instead of maintaining a single friendRelations table containing a list of relations of all users on my network it would be better to make a separate Relations table for each user on network, that contains profileIDs of all people & groups the user chooses to follow. This way retreival would be quite faster... any suggestions would be greatly ap开发者_StackOverflow中文版preciated...!!


Remember that databases are generally quite good at indexing (assuming you give them suitable columns to index) so retrieval for a specific user should be fast in any case. Creating a bazillion tables may be slower overall.


This seems like a drastic design decision to eliminate a problem that probably won't exist. Knowing very little about how your database is constructed and accessed, it's impossible to say whether this is a bad decision (probably) or if your business requirements are unique and this is the solution (unlikely). My recommendation would be to determine the level of normalization you need, and don't try to eliminate performance issues that don't yet exist.

Should I normalize my DB or not?


If you have performance issues with your database queries for retrieving information I strongly recomend you to use the Vertica database, which is incredibly fast.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜