The wild, crazy world of databases

NoSQL offerings like Couchbase and MongoDB are making people think differently about the way they power Web apps

Who would have thought databases would become one of the most thrilling areas of technology? A visit to Couchbase in Palo Alto, Calif., this past week reminded me of how NoSQL is shaking things up. It's early days, but after all this time, it's fascinating to see cracks spreading across the SQL monolith.

For years, technologists and businesspeople concurred: Oracle was the gold standard in databases. The Oracle Database had the most features and the highest reliability, and it crushed its rivals. Sure, the licensing fees reflected Oracle's dominance, but paying for the best was worth it.

[ Andrew C. Oliver answers the question on everyone's mind: Which freaking database should I use? | Also on InfoWorld: The time for NoSQL standards is now | Get a digest of the key stories each day in the InfoWorld Daily newsletter. ]

Those who couldn't afford Oracle could always turn to the open source alternative MySQL. It wasn't industrial-strength like Oracle, but as a back end for Web applications, MySQL became wildly popular (no doubt a big reason why Oracle bought Sun).

That was it: Your choice of heavyweight and lightweight SQL solutions . . . from the same company, once MySQL fell into Oracle's clutches. Of course there were alternatives -- from IBM DB2 to Microsoft SQL Server to PostgreSQL -- but the database realm was generally an uneventful place to be.

NoSQL is changing all that. I don't mean to say that NoSQL is currently a major threat to Oracle's business, at least not to the part that serves high-throughput, high-availability transaction environments. But for highly trafficked Web applications with many reads and few writes, NoSQL databases make a compelling case for themselves.

What type of SQL databases am I talking about? Mainly, key value pair and document databases, the benefits to both of which were capably explained to me by Couchbase CEO Bob Wiederhold last week. (For a full taxonomy of NoSQL database types, see the excellent article "Which freaking database should I use?" by InfoWorld's Andrew Oliver.)

The wonderful thing about key value pair databases like Couchbase is their simplicity. You don't need to fret about data models or relationships between tables. You have a unique identifier -- the key value -- that maps to an object, the contents of which the database does not concern itself. As Wiederhold explained, "it's basically set and get." You enjoy blazing performance and the ability to scale out just by adding commodity servers; if a server goes down, distributed redundancy keeps the database humming.

A document database works in a similar manner, except the object is not opaque -- it's a JSON (JavaScript Object Notation) document. The elements inside documents can be queried and indexed. But as with key value pair databases, you are not bound by a rigid schema; you can add elements to a document if you need to, without worrying much about the content of other documents. Compare that with an RDBMS, where such additions would incur a redo of the data model and a rethink of relationships among tables.

When it comes to scaling, an RDBMS tends to demand a beefy server that you must scale up rather than out -- in other words, you upgrade the horsepower of a single server rather than simply adding commodity servers as needed. When you run out of performance headroom on your single RDBMS server, you then have to "shard" the database across multiple servers, which incurs its own complications. Alternatively, as Andrew Oliver observes, you can opt for an RDBMS solution like Oracle RAC (Real Application Clusters), which is designed to scale out rather than up -- but Oracle RAC in particular is quite difficult for developers to write to.

As Wiederhold told me, one of the great advantages of both key value pair and document databases is that they're both more natural for developers to write to than relational RDBMSes. Wiederhold also noted that Couchbase was becoming a document database in its 2.0 release, coming in just a few weeks. The InfoWorld Test Center is already champing at the bit to review it; it will be interesting to see how it stacks up against the incumbent document database leader MongoDB, which InfoWorld's Andrew Glover reviewed last February.

Although Couchbase and MongoDB represent the sweet spot of the NoSQL market right now, there's much more -- like graph databases or columnar family databases. You could even lump in Hadoop if you like, though it applies almost entirely to analytics for semi-structured data. In fact, each NoSQL type is suited to its particular set of applications -- marking the twilight of the SQL RDBMS as a one-size-fits-all tool.

One final observation: Note that NoSQL lends itself to Web applications and, in fact, many large early customers are SaaS providers. As with many exciting new technologies today, NoSQL is helping enable the migration of technology from the corporate data center to the cloud.

This article, "The wild, crazy world of databases," originally appeared at InfoWorld.com. Read more of Eric Knorr's Modernizing IT blog. And for the latest business technology news, follow InfoWorld on Twitter.

From CIO: 8 Free Online Courses to Grow Your Tech Skills
Join the discussion
Be the first to comment on this article. Our Commenting Policies