DEV Community

Discussion on: Explain NoSQL Databases Like I'm Five

Collapse
 
nestedsoftware profile image
Nested Software • Edited

This is a bit of tricky question, because the typical characteristics of NoSQL databases can be a pro or a con depending on what you want to do.

I think the single biggest idea behind NoSQL databases is that it is easier to scale them to more users (horizontal scalability). This is done by adding more servers rather than by increasing the capacity of an existing server. The downside to this is that you don't get the same guarantees with transactions that you get with (relational) SQL databases. Different users may see different versions of the same data, though usually for short periods of time - this is called "eventual consistency."

You probably don't want to use a NoSQL database to handle banking transactions. You could end up with a situation where you transfer money from one account to another, but the money appears to be both in the new account and the old one, or that it disappeared from the the old account, but isn't in the new one yet.

In really big internet applications, say social media, being able to scale is the most important thing, and having data consistency across all users isn't as valuable: Maybe I see your latest tweet, but someone else won't see it for another minute.

Collapse
 
kenbellows profile image
Ken Bellows

So, is it impossible, or infeasible, to implement eventual consistency with SQL databases? Is there something fundamental to how SQL DBs work that makes this difficult? If so, it seems like it would be a bummer if the problem you're solving is structurally more appropriate for SQL, but you need it to run at a very large scale and don't need the immediate consistency

Collapse
 
nestedsoftware profile image
Nested Software • Edited

There is such a thing as distributed relational databases, known as NewSQL. In fact, they seem to offer stronger guarantees than eventual consistency (in hopefully rare cases, they'll compromise on availability). For instance, Cloud Spanner, NuoDB.

Thread Thread
 
kenbellows profile image
Ken Bellows

Huh, that's super interesting! I'll have to dig deeper on that one