Document-Oriented or Graph databases

1.1k Views Asked by At

It's a RoR project.

We want to store user activities, like uploaded a photo, voted for somebody, followed somebody, etc. When listing the activities, we need to list your friends activities as well. So, what is better to use in this case: a document-oriented database (couchdb, mongo db), a graph database (neo4js), or maybe some other approach?

Thank you for helping in advance guys :)

4

There are 4 best solutions below

0
On

Yeah, I think Neo4j is a good choice, the Rails 3 support is excellent, see https://github.com/andreasronge/neo4j, see even the social examples with cypher like in http://docs.neo4j.org/chunked/snapshot/data-modeling-examples.html, and for activity streams, there are various cool approaches like Graphity, see http://www.rene-pickhardt.de/graphity-an-efficient-graph-model-for-retrieving-the-top-k-news-feeds-for-users-in-social-networks/

0
On

Depending on the scale of your application, and volume of activity, I'd recommend a combination of Couchbase (not CouchDB) for actual activity data which is extremely scalable and fast, and Neo4J for the graph discovery (both databases at the same time). I've used the combination very effectively in my application that was both social and real-time.

If you want more info from me, please feel free to contact me directly and I can help with architectural decisions or implementation help.

0
On

Consider using Sqlite. It is a flat file mimicing database and can be used as an embedded database.

0
On

Take a look at Infinitegraph. It is scalable unlike neo4j. I think they have a free download for 1 million nodes.