1

From my current limited understanding of NoSQL databases, it seems like there are two basic elements.

First, how they store data compared to SQL databases. NoSQL databases store a blob of data, possibly json, indexed by a primary key.

Second, from reading a bit about popular NoSQL databases, it sounds like many NoSQL database developers chose to favor availability vs consistency. For example, MongoDB didn't have full ACID compliance, Cassandra doesn't have ACID compliance, etc. Nothing wrong with that, just depends on the use case. Availability vs consistency is a well known tradeoff.

Here is my question: What specifically is it about the schemaless paradigm that couples it to availability (vs consistency)? At a high level, seems like these two things are orthogonal, no? (nosql vs sql is one tradeoff, and availability vs consistency seems to me like it should be an entirely separate tradeoff)

3
  • It's not a favor, it's a technical limitation. Commented Jan 3 at 11:02
  • What's the specific technical limitation in this case? Commented Jan 3 at 18:56
  • What does "availability" mean above? by "Consistency" do you mean the "C" in ACID, or do you have some other definition in mind? Commented Jan 4 at 22:57

4 Answers 4

1

Non-relational data stores are not new; NoSQL DBMSes specifically were born out of the desire to simplify horizontal scalability, which requires sharding, or horizontal partitioning.

A distributed database, however, cannot perform well if it tries to maintain immediate consistency, and eventual consistency was the cost people were willing to pay for the ability to scale.

At the same time, sharding is difficult with a properly normalised relational model, so it was natural to choose non-relational models for highly distributed databases.

In short, both non-relational data models and eventual consistency are characteristics of the distributed database engines that can scale well horizontally.

0

It isn't a tradeoff. Responsibility for consistency is moved from the database to the application code. The database is relegated to storage device.

2
  • There isn't a tradeoff between availability and consistency? Commented Jan 3 at 18:57
  • NoSQL is mostly hype. Commented Jan 4 at 22:59
0

I think the relationship is probably more about how those cavalier enough to abandon schemas are also cavalier enough to abandon transactional consistency!

Achieving each of these typically imposes some kind of development cost, and you can save that cost by simply discounting/ignoring the problem they solve in the first place.

To what extent those now-unsolved problems cause costs elsewhere, and whether those problem-costs exceed the saved solution-costs, is a question that is very specific to the application.

I also don't think they are always choosing availability over consistency. They are probably more often choosing perceived economy over consistency. I think it's just that with fewer consistency constraints, the system is naturally more available, and that then gets hyped-up as a feature, rather than admitting the real underlying logic which is "we save money on development by accepting certain classes of defect which others are not accustomed to accept"!

With SQL vs NoSQL, the trade-off is often more complicated than can be feasibly reasoned about.

SQL engines tend to be mature technologies which perform adequately for a variety of applications. Usually, the proposed alternatives can be seen to have some kind of advantage, except generality. That is, NoSQL technologies are heterogenous and far more specific in their area of application, and outside those areas they perform inadequately.

A company might get away with using SQL engines for all data stored under their roof, but they probably cannot get away with using one specific NoSQL technology for everything under their roof. Instead they end up with a menagerie of technologies, each with their own incompatibilities or incommensurate concepts, and each needing their own specialist zookeepers amongst the staff.

More often, I suspect the choice to use NoSQL technologies either comes down to perception of clear up-front costs of SQL engines, like licences, against benefits which are more difficult to quantify, or the use of one or the other comes down to the tastes and preferences of the developers and managers involved. I suspect there is rarely a fully-rational evaluation, because the question is simply too complicated to weigh, and that developers are not in fact "trading off" the merits of the two possibilities.

-1

NoSQL is basically non-reliational databases. although some "marketing types" try to push it

If there are no mechanisms to relate data there is no way to enforce consistency.

So if you don't do a thing, everything you do do is de-facto prioritised higher.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.