Hacker News new | ask | show | jobs
by SnacksOnAPlane 2693 days ago
I still haven't seen a great reason to go NoSQL over, say, Postgres. I'll think about a good application but then realize that it'll be a PITA to do something slightly different than what I first imagined.

What are good reasons to use NoSQL over SQL?

4 comments

Usually the bigger reasons are easier scaling. By taking a different approach to data, it's often easier to scale across data centers etc. The second being the shape of your data. If most requests are simple key/value queries, a much simpler model can work better, more so if you can keep all your data for a given query together (document dbs in particular), this can have performance benefits over a typically normalized database.

Another is when you need read and more specifically write performance that a single system cannot keep up with. When you hit these boundaries, it gets interesting. Sometimes it's just easier to design for such a system up front.

If it's an internal application SQL first is probably fine, if it's SaaS you may want to look at alternatives.

I'd love to use Postgres, but Firebase is really nice in that it provides first class libraries that abstract away the requests and querying, to the point where querying Firestore just feels like calling an async function on your front end. Plus, you don't even have to think about deploying. There's something really great (and risky) about having an always deployed, always ready backend. Also basic user auth is really easy.

If you're doing a long term project, then Postgres makes sense since the deployment/setup costs are one time. But for short projects Firebase is very nice.

But there are managed Postgres services in almost all cloud providers.
All other things being equal, I wouldn't go NoSQL over Postgres.

What makes Firestore interesting to me (not used it in production) is that you can avoid the need for a backend completely. Your normal architecture is Client <-REST-> Backend <-> DB. You can avoid all the deployment and development in the backend by doing the work in the client.

"SQL vs NoSQL" is mostly just buzzy clickbait type arguments.

My understanding is for Firestore specifically, its a document store with some conflict resolution semantics that Postgres does not provide.