5 ms·
What would be your choice of DB for a commenting system?
Hello HN fellows - I've "the next best idea" since sliced bread... on how to write a commenting system similar to disqus, spot.im, except better. Would you use an RDBMS (e. g. postgres) or a graph database (e. g. neo4j) to model the conversation threads? I may also want to enable commenters to insert emojis, a very limited subset of html for external links and font styling. It has to scale to tens, possibly hundreds of thousands of simultaneous users, most of which will be posting relatively short payloads via http(s) as comments are almost always limited in length.
Reason I ask is I've heard certain commenting systems use a graph database and others an RDBMS. I've zero experience building commenting systems with either.
Thank you.
- stevekemp 10y agoI wrote a simple system like disquis, which you can find here: https://github.com/skx/e-comments/ https://github.com/skx/e-comments/ I just used SQLite, but psql/mysql would work just as well. Handling comments, even threaded ones, isn't likely to be too heavyweight.
- ploggingdev 10y ago> I've "the next best idea" since sliced bread... on how to write a commenting system > It has to scale to tens, possibly hundreds of thousands of simultaneous users My suggestion : just use a database you are familiar with and start building. Most comment systems use a rdbms, so that's a safe bet. Use a graph database only if you find a strong technical reason to do so, not because another company is using it.
- 1ba9115454 10y agoAlways use an RDBMS in the first instance, it's simpler, better understood and will perform really well. If you need extra performance later on, you can always add an extra layer.
- ddorian43 10y agoUse postgresql and when/if you grow big pay somebody or learn to scale it. Only use non-rdbms when you need something special, say, full-text-search, or insane performance (in-memory-kv) etc.
- joeclark77 10y agoRDBMS is probably fine. If you want to try something new and shiny, a document store (like MongoDB) is probably better than a graph DB, because nested comments and replies can be easily and naturally represented by nested documents -- objects containing lists of embedded objects containing lists of [etc...]