News for hackers. Stuff that matters.
Re:Why NoSQL by lmm on Wednesday October 06, 2021 @01:01AM (#28769378)
Make sure each datastore has a clear owner, and access it via that API rather than directly. If you really must share a datastore, use a schema registry. Sharing between multiple applications doesn't really work for SQL database either (e.g. if you have multiple applications writing to your database in transactions then you're virtually guaranteed to get deadlocks).
Re:Why NoSQL by irishsultan on Wednesday October 06, 2021 @06:41AM (#28771439)
> (e.g. if you have multiple applications writing to your database in transactions then you're virtually guaranteed to get deadlocks).

That assumption is only true if the DB is continually used by different applications. The reality is more likely a large number of applications used by a relatively small set of users, so most of the time there won't be any application writing, and it would be extremely rare for multiple applications to write at the same time.

Re:Why NoSQL by smorgusofborg on Wednesday October 06, 2021 @10:32AM (#28773628)
Are rare deadlocks better than frequent ones? That sounds like a good way to not know you have problems.
Re:Why NoSQL by tdrdt on Wednesday October 06, 2021 @04:27AM (#28770553)
This only works in theory.

In reality sometimes access via an API is way too slow or is lacking flexibility.

And I don't get this: "(e.g. if you have multiple applications writing to your database in transactions then you're virtually guaranteed to get deadlocks)"

Isn't this why transactions exist in the first place?

Re:Why NoSQL by belk on Wednesday October 06, 2021 @06:21AM (#28771289)
depends on what level of isolation and how it's done, MVCC avoids deadlocks, but if you manually lock any row/table, you can still run into deadlocks. but the DBMS' transaction manager will notice and timeout one of the transactions, failing it.

While MVCC avoids deadlocks, you'll still get a lot of failed transactions if they all operate on the same data at the same time, which you'll have to retry, but I'll take that over data inconsistency

Re:Why NoSQL by nine_k on Wednesday October 06, 2021 @07:51AM (#28771970)
Quite often you have several applications that look up each other's data, but mostly write to their own tables.

(But indeed, with uncoordinated development, deadlocks can occur. Still better than data corruption.)