News for hackers. Stuff that matters.
Re:Ask HN: Best beginner database? by user5994461 on Wednesday October 26, 2016 @06:16PM (#12801180)
MongoDB is never acceptable. Let's make this short and concise.

[edit: fail. This answer is crazy long. Seriously, this topic should be covered in a book. I'll write one some day]

--- ONE DECISION RULE TO RULE THEM ALL: SQL databases are easier to use and maintain than NoSQL databases. Always use SQL when possible, only use NoSQL when forced to.

--- If you have less than 1 TB of data, you should use a normal SQL database.

It's the easiest to use, it runs on a single node, it supports "JOINS", it supports transactions, it fits all the most common needs.

The usual free SQL choice is PostgreSQL. Sometimes it's MySQL instead (mostly for the Apache+PHP+MySQL stack for which there is cheap hosting service available).

--- If you have more than 1 TB of data, you have to use a NoSQL database. (Cassandra, ElasticSearch, Riak)

They support splitting data and operations over multiple nodes which is necessary to handle this scale. The downside is that they can't support joins nor transactions because of that.

--- Never use MongoDB.

99% of projects should use a traditional SQL database as per the major rule. The project is simple enough, SQL is fine!

The 1% of complex web scale projects MUST NOT use MongoDB under any circumstances. MongoDB has know reliability and scalability issues that WILL lead to disaster. Use either ElasticSearch or Cassandra instead (depending on the usage).

There are no comments on this comment yet.