3 ms·
NoSQL or SQL – how you make the choice?
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?
- necovek 4y agoIf 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.
- michallipka 4y agoThank you!
- zaphar 4y agoDepending 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.
- brudgers 4y agoMy 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.
- michallipka 4y agogreat, thanks!
- botten 4y agoGo with SQL until you hit a wall (most likely you won’t).
- rawgabbit 4y agoIf you need to create reports, go with a SQL database. Trying to create reports on a NOSQL database is an exercise in futility.
- ffhhj 4y agoUse SQL without foreign keys for best performance [0]. [0]: https://github.com/github/gh-ost/issues/331#issuecomment-266027731 https://github.com/github/gh-ost/issues/331#issuecomment-266...
- 1_1xdev 4y agoUse a relational db unless you know it won't work for your app and you can articulate why it won't work.
- labarilem 4y agoThe 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.