databaseneo4jgraph-databasesnon-relational-database

In which case should we use Neo4j or other graph database?


I want to make a blog website and I need a comment system (user can add comments for each article).

take those into consideration:

  1. save lots of comments
  2. I will save like count
  3. I need to rank those comments (the score of a comment is calculated by like count and time, and will change with time)

As there will be lots of insert(add comments) and update(update like count) operations, and I need to range select comments by score of comment, I think relational database is not suitable.

Is Neo4j suitable for this situation?

I want to save each articale and comment as a node of neo4j


Solution

  • As there will be lots of insert(add comments) and update(update like count) operations, and i need to range select comments by score of comment, I think relational database is not suitable.

    That is interesting, because it is pretty much one of the things a relational database excels at. That said it is a rather trivial tasks and any database relational or otherwise should be able to handle this until you get into many millions of comments.

    so, is neo4j suitable for this situation?

    As said above, I'm sure Neo4J can handle it. But I don't see anything that plays to the strengths of a graph database. You don't have a complex graph. Your graph simply consists of two types of nodes (article and comment) with each comment referencing exactly one article.

    I personally consider an RDBMS as the default choice once a flat file isn't sufficient anymore. So I'd pick an RDBMS here as well. But again, the requirements you gave should be easy to handle by any database.