

Ask HN: When do you use SQL vs NoSQL? - veesahni

Some people like SQL, some like NoSQL.. some have used PostgreSQL and moved to MongoDB, and some vice versa. But at the end of the day, it usually comes down to "use whatever you're comfortable with"..<p>So I'm wondering, what data patterns are more appropriate to SQL vs NoSQL datastores? Can such a decision even be simplified to 'data pattern'?
======
davismwfl
So it depends... And my list isn't all inclusive/exclusive, just a general
starting point I like to use.

I generally use SQL when I have really well defined relationships that change
rarely and where I have data that needs to be shared amongst many disparate
systems (especially if I don't control one or more of them).

NoSQL I use more as an application specific data source and cache. Many times
this means warming up the NoSQL from the relational side for some data
elements. I really don't like to pollute a SQL datastore with application
specific components unless they need to be shared and I don't control all the
applications.

I don't agree with people that draw the line at the need for transactions.
Transactions can be managed in either SQL or NoSQL and even across them both
with some care.

