Domanda

I am new to graph database, so wanted some idea of designing a simple social things:

A User will have the following property:

userId, name, sex, dob, about, place, country,........some other fields

A post will have the following property:

postId, text, date, postedBy, like, follow

Now suppose there are user U1, U2, U3, U4 Posts: P1,P2,P3,P4

Now my question is what amount of information should i keep in graph db. Let say

  • for vertex U1 shall I keep all information (userid,name,sex,dob.....) of users with it in the graph database only.

  • for vertex P1 shall i keep all information(postId, text, date, postedBy, like, follow) with it in the graph database only.

OR

only partial information e.g

  • for user vertices only userId and name and rest information should be in Nosql or Relation db

  • for post vertices only 'postId and text` and rest information should be in Nosql or Relation db

I just wanted to know common practice in Graph DB world for this kind of scenario?

I am using Cassandra and thinking of using Titan Graph Database.?

Next question, which one is better choice to notify all users involved in the discussion about any new comment,likes...

È stato utile?

Soluzione

Titan and virtually any graph database will be good at storing all the information you cited. In most cases, the main thing you want to avoid putting in the graph, as far as a data type goes, would be large amounts of binary data, like a file/image. Such things are best stored elsewhere, like Amazon S3, and just referenced within the graph in some way as a pointer.

As far as "notifications" go, I'm not sure I understand your question. How you choose to "notify" a user of "something new" isn't really a function of the graph or cassandra. If you really just mean, how do I go about recommending the newest posts to a user, then a graph database is fine for that and Titan would likely be the best choice due to its support of vertex centric indices. You would basically create an index that sorted your edges from user to post by descending date order and could then easily grab the first 10 newest posts.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top