Quiz
- How popular would you say that SQL is compared to NoSQL?
I would say there are more SQL database than NoSQL databases (every company has at least one SQL database), but more data in NoSQL databases. See: MongoDB for a new Era.
- Correct me if I am wrong, but it sounds like SQL already has ACID properties. Why then, is it hard to join across multiple disks in a cluster?
Yes, SQL has the ACID properties. But SQL isn't (usually) spread across multiple servers in a cluster. (There are always multiple disks.)
Coordinating transactions across multiple processes on single server is tough enough, let alone across multiple servers. In order to, say, lock a collection/table or some documents/rows, you'd have to do network communications, which are (relatively) slow.
- Why do so few NoSQL databases have ACID properties? What is the drawback of ACID, assuming you are not the one who has to implement ACID?
See the second part of the previous answer.
The drawbacks of ACID are (1) that it's (somewhat) difficult to do, and (2) doing so may slow down concurrency.
- I'm curious about consistency with NoSQL, specifically in the reading where it says:
The same query might yield slightly different results depending on which server it goes to and other details. But in many applications, that doesn't matter
Could you explain why a query might have different results depending on the server, and why that doesn't often matter?
Suppose the query is "how many iPhone 15s do we have?" maybe for a shopping site. If the inventory is spread across multiple servers, and they aren't closely coordinated, the answer might be inexact.
But most of the time, the exact answer isn't necessary. The customer just wants to know if there's more than one, and the supply chain manager wants to know if it's time to restock, neither of which needs to be exact.
Financial accounting needs to be exact, but lots of other things don't.