NoSQL or SQL – how you make the choice?

9 points by michallipka ↗ HN
I am developing SaaS solution and need to decide on a path forward with regards to database - SQL or noSQL (document db).

I am not technical, so are there any developers here that could advise on how would you go about deciding which approach to take?

10 comments

[ 4.3 ms ] story [ 33.0 ms ] thread
If you don't see a need to massively scale horizontally from the get go, SQL. (And if you need to ask the question, you are likely not equipped to handle parallelism/distributed issues coming out of not having ACID guarantees)

A good way to estimate that is if you'll be mostly writing to the database instead of reading from it.

You can also go half-way with things like object storage in Postgres (jsonb fields), so that's usually a no-risk choice for a project in an early phase of development.

Depending on your needs you can go halfway with sqlite and the json extension as well. In general I start with sql and then when it becomes clear I need to I'll use a NoSQL to optimize or improve some portion of the application. I find that sql is usually the right default and you'll go quite a ways before you outgrow it. If you do reach the point where you are outgrowing it then your needs are going to make the correct NoSQL solution pretty obvious.
My take:

  Document DB for searching.

  SQL for querying.
Or if your life is easier when

  42 is a string, use a document DB.

  42 is a number, use SQL.
Usually, people want to search, not query, and most information is unstructured.

That's why Google is useful.

Good luck.

Go with SQL until you hit a wall (most likely you won’t).
If you need to create reports, go with a SQL database. Trying to create reports on a NOSQL database is an exercise in futility.
Use a relational db unless you know it won't work for your app and you can articulate why it won't work.
The answer might be quite complex, especially since the OP is not technical. But, in my experience, it really boils down to this. If you don't have any particular requirements, just go for relational.