Hacker News new | comments | show | ask | jobs | submit login
What would be your choice of DB for a commenting system?
8 points by martin1975 98 days ago | hide | past | web | 9 comments | favorite
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.




> 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.


I wrote a simple system like disquis, which you can find here:

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.


Always 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.


Use 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.


Both MySQL and Postgres support full text searching.


Both suck at it for many reasons.


Well that's a compelling argument, I'm sold.


Im too lazy and on a phone but you gotta trust me on this one.


RDBMS 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...]




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: