开发者

Which database have you had the best experience with to handle friending on the back end?

开发者 https://www.devze.com 2023-03-22 22:43 出处:网络
Since my last question was considered subjective :( , I\'m trying to make it more specific. I\'m building an application in PHP where users can \"friend\" each other. This seems to be best suited to

Since my last question was considered subjective :( , I'm trying to make it more specific.

I'm building an application in PHP where users can "friend" each other. This seems to be best suited to a graph datastore... For example, you can have this set of fields in a traditional RDBMs:

id | user1 | user2

and you have to deal with duplicate data (id = 1,user1 = Joe, 开发者_如何学编程user2 = Jeff, id=2, user1=Jeff, user2=Joe)...

You also have to search both columns for one user.

When performing certain friend of a friend searches, the recursion can be tricky indeed.

  1. Do you agree a graph database is best?
  2. If so, which one? and why is it best in your experience?
  3. Since client already has MySQL, is it worth the overhead to obtain a graph store, or is there a good approach to the main issues with friending while keeping it in MySQL.

P.S. TO MODERATORS: If you still have a problem with this post, I'd most appreciate if you could tell me if there's any particular way to ask this question and be considered a "constructive" post? gmail me (joedevon), tweet me (joedevon), add it in a comment. whatever method suits you best...

I just want some input from fellow programmers and I think the problem is common, filled w/ opportunities and issues, and interesting. Amazed that the original wasn't considered good for SO, but thems the rules...


Maybe it would be relevant to mention what language you use for building that app. If it is Java, I think there is no real competitor to neo4j. (my opinion)

Maybe you've already seen these neo4j presentation series, but in the 200. second of that presentation, you can see use case for Polyglot persistence, which means that you could utilize your existing data model or data model that doesn't need to be type free or isn't suitable for Graph data model, TOGETHER with the aspect of application (user bonding and relationships) that would use neo4j under the hood and its graph data model.

Spring Data project makes this really easy and I consider this a very perspective way to go.

0

精彩评论

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

关注公众号