Reputation: 3070
I am building a social network natured web app. there are a number of related entitites like publishers, users, publications, posts, comments; with relations like subscribe, like, share, comment, friend, follow, work, author. Also as usual there is content of some of the entities lie contents of publications, posts, comments.
Publications and Posts are similar and just like classical social posts with more than one text or one media files. And Publications, Posts, and Comments will be ever increasing and will reach high numbers.
I plan to use Cayley db maybe dependence on Postgresql.
My so far complete tuples describing relations of entitites are so:
publisher -publish- publication
user -subscribe- publisher
user -comment- publication
user -like- publication
user -share- publication
user -post- post
user -friend- user
user -comment- post
user -like- post
user -share- post
publisher -follow- publisher
user -work- publisher
user -author- publication
The question is:
Where to store my posts/comments, which have also content such as one to many text fields and media files, and will be liked, shared, and commented by users?
Should I store posts/comments in graph database, if so should I store content or store only a reference and store content in another database, table or document? Regarding quantities of these entities will reach large numbers.
Upvotes: 0
Views: 219
Reputation: 2367
Stumbled upon this open question and thought I try to answer it for future reference.
And of course it totally depends on your implementation and the requirements. Comments you can store in Cayley, but I would leave images/video or other media out of it. Just store a URI to the specific resource or an UUID for the object in another datastore.
Also for comments; you could store the UUID/ID for the comment in your graphdb and store the actual comment in Postgres or even in a file on disk (just as an example).
I personally prefer to keep my graphdb as small as possible and store actual content in a different storage.
Upvotes: 1