
What would be your choice of DB for a commenting system? - martin1975
Hello HN fellows - I&#x27;ve &quot;the next best idea&quot; 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.<p>Reason I ask is I&#x27;ve heard certain commenting systems use a graph database and others an RDBMS. I&#x27;ve zero experience building commenting systems with either.<p>Thank you.
======
ploggingdev
> 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.

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

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

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

~~~
stephenr
Both MySQL and Postgres support full text searching.

~~~
ddorian43
Both suck at it for many reasons.

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

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

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

