Philosophy 101: A reason to consider using a NoSQL implementation

Note: the cross-section of people interested in philosophy and also interested in NoSQL is close to zero, but it’s my blog and I blog what I want to, blog what I want to.  The general philosophical point applies to all of life, the usage of NoSQL to discuss it might be interesting to people interested in NoSQL.

This might not come as a surprise to anyone, but developers tend to be an opinionated bunch (ask me what I think about TDD).

On a factor of something like 5X, DBAs are worse.  I believe I have some standing to state this, as I am one.

There are various topics that get discussed in DBA-land that, quite frankly, approach dogma-level.  To be clear, within some particular context, there might be right or wrong, better or worse answers to some questions, but they are almost always discussed at a level that ignores context and so become largely pointless.  Some random examples:

  1. Should you use stored procedures or not?
  2. Should you use surrogate or natural primary keys?
  3. Should all database access code go through DBA review or not?

In case anyone is wondering, the correct answer to these questions is as follows:

  1. You should never use stored procedures unless they are necessary.  When are they necessary?  When they need to be used.
  2. It doesn’t matter, unless it does.
  3. No, unless it needs to.

I can imagine dozens of reasons why people will disagree with my analysis of what the correct answers are.  They are all wrong.

Ignoring that for a minute, and getting to how this deals with NoSQL:

I have often joked/commented that SQL Server (and this true of all RDBMS) is somewhat similar to quantum mechanics in that the results of any analysis of SQL performance/design/architecture/whatever is affected by the act of observation, and that it can appear to be ‘random’, where, e.g., the same query can perform differently when run in different contexts.

The randomness factor can be attributed to a number of things

  1. The performance of a query is directly tied to the data present, which can obviously change over time.
  2. The performance of a query is (usually) directly tied to the indexes and statistics that support it, which can obviously change over time.

The observation factor can be attributed to a number of things:

  1. When you want to test a query that hits SQL Server, you typically use SQL Profiler to do so.  The use of SQL Profiler can directly impact the results of a query (in fact, if you are ‘good enough’, you can crash SQL Server if you set up a profiler trace incorrectly).
  2. I’ve been told that the same applies to Oracle.

Getting back to the dogma stuff:

  1. It is almost impossible to prove the pro or con of any of the questions I listed, in large part because of the quantum mechanics like behavior of RDBMS. 
  2. The technical details/specs/whatever of almost every RDBMS are agnostic towards the dogma stuff.
  3. Almost every DBA (including myself) is influenced by real-world experience, almost always negative real-world experience, that drives us to a particular set of conclusions, conclusions that cannot be disproven directly, due to the quantum mechanics like behavior of RDBMS.

Get to the point already about NoSQL

If you have the ability to implement a NoSQL solution, you immediately free yourself from having to deal with this dogma. 

I have absolutely no doubt that, given enough time, there will be NoSQL-related dogma built up, but for now, there is a freedom in being able to implement an implementation, and see the results. 

I have little doubt that any NoSQL implementation will eventually run up against the quantum mechanics like behavior of an RDBMS system.  This is because of the nature of data in general.

What the hell does this have to do with Philosophy?

The answer to this question begins with a posit about human nature that is undeniably true, but which many people would want to deny:

Almost everything that you believe is believed for largely non-rational reasons.

This includes what you believe about SQL, politics, religion, and everything else.

A couple of points to be made here

  1. I said ‘largely’
  2. I said ‘non-rational’, not ‘irrational'.’  This is especially important.

We believe the things we believe on the basis of many different things.  Our upbringing and our personal experience are two of the main sources.

Not to put too fine a point on it, but life is pretty complicated.  The various ‘inputs’ that drive our habits are pretty varied, and this applies to life in general as well as to our beliefs involving technical matters.

If we were forced to provide rigorous validation for the things we believe, we would hardly be able to get out of bed, much less lead our lives.

Because of this fact (and it is a fact), we tend to gravitate to reasons that fit our experience.  Obviously, this doesn’t mean we don’t learn, but, all things being equal, we tend to lean in a certain direction by nature, because to do otherwise would prevent us from acting on our beliefs.

This doesn’t mean that our beliefs are irrational.  Irrational beliefs are, generally speaking, beliefs that we have that we refuse to give up even when experience tells us we should.  Non-rational beliefs, generally speaking, are beliefs that we have that we don’t really look for support for, largely because we don’t have any reason to look support for.

I believe the things that I believe through a combination of personal experiences and the experiences of others that make sense to me.  Many of the things I believe are ‘non-rational’ in the sense that I simply accept what other people who make sense to me have expressed.  But the ‘who make sense to me’ caveat is tied to my own personal experience.

Though some think that this fact is despairing, I think it is par for the course.  To use a standard philosophy example, why do you believe the sun will rise tomorrow?  Well, it always has.  So what?  Well, science tells us it will.  So what, science is wrong all the time?  Well, it isn’t about this.  So what, why can’t it be wrong this time about this?  Well, stop asking me stupid questions about the sun rising tomorrow, if it doesn’t, I’ll deal with it then, in the meantime, I will hold the largely non-rational belief that it will.  And by the way, shut the fuck already.

Debates about whether or not to use surrogate or natural keys really end up in the same position.  If we have used surrogate keys in the past and it has caused problems, we will tend to use natural keys.  Or the opposite.

It would be easy to think that what I am saying is that it never matters which we use.  That would be incorrect.  It does matter within a particular context.  Just don’t think that the answer crosses context.

posted on Tuesday, October 11, 2011 10:26 PM Print
No comments posted yet.

Post Comment

Title *
Name *
Comment *  
Please add 1 and 6 and type the answer here: