The proliferation of non-relational databases in the tech sector these days could lead you to think that these data management tools (also known as NoSQL databases) are eventually going to make traditional relational databases extinct.
Not so. Each of these database types is best suited for very different types of workloads, and that's going to prevent either one from tromping the other into the dust. Which means that IT and other managers are going to have to figure out which approach is best suited for the task at hand.
In this two-part series, I'll examine the capabilities of both NoSQL and relational databases to help you make the right decisions for your organization.
"NoSQL"? More Like "Not Only SQL"
Right off the bat, NoSQL databases are unique because they are usually independent from Structured Query Language (SQL) found in relational databases. Relational databases all use SQL as the domain-specific language for ad hoc queries, while non-relational databases have no such standard query language, so they can use whatever they want. That can, if need be, include SQL.
NoSQL databases are designed to excel in speed and volume. To pull this off, NoSQL software will use techniques that can scare the crap out of relational database users — such as not promising that all data is consistent within a system all of the time.
That's a key result of using relational databases, because when you are conducting a financial transaction, such as buying something on Amazon, databases have to be very sure that one account is debited the same amount that another account is debited at the same time.
Because so much of this back-and-forth read-write activity is needed in a single transaction, a relational database could never keep up with the speed and scaling necessary to make a company like Amazon work.
According to Bob Wiederhold, CEO of NoSQL database vendor Couchbase, the architecture and features of NoSQL databases bring four key advantages to NoSQL users.
Go Big Or Go Home
Easier scalability is the first aspect highlighted by Wiederhold. NoSQL databases like Couchbase and 10Gen's MongoDB, he said, can be scaled up to handle much bigger data volumes with relative ease.
If your company suddenly finds itself deluged by overnight success, for example, with customers coming to your Web site by the droves, a relational database would have to be painstakingly replicated and re-partitioned in order to scale up to meet the new demand.
Wiederhold cited social and mobile gaming vendors as the big example of this kind of situation. An endorsement or a few well-timed tweets could spin up semi-dormant gaming servers and get them to capacity in mere hours. Because of the distributed nature of non-relational databases, to scale NoSQL all you need to do is add machines to the cluster to meet demand.
There's No Need To Fear
Performance is another way that NoSQL databases can excel. First, every time you add a new server to a NoSQL database cluster, there is performance scaling by virtue of the fact that you're throwing another processor into the equation.
Beyond the scaling advantages, the very architecture of NoSQL tools aids performance. If a relational database had tens or even hundreds of thousands of tables, data processing would generate far more locks on that data, and greatly degrade the performance of the database.
Because NoSQL databases have weaker data consistency models, they can trade off consistency for efficiency. In Wiederhold's social gaming example, if a user updated his or her profile, there's no real degradation of game performance if that profile's new info isn't updated across the entire database instantly. This means that resources can be dedicated to other things, like tracking down that orc that's about smack you around in-game.
Objects Of Desire
When applications developers have to work with data in relational databases, it can at times be troublesome due to data mapping and impedance issues. In NoSQL databases, this is not usually a problem, because data is not stored in the same manner.
With document-oriented NoSQL databases, for instance, data is stored in just that format: documents. And since documents are objects, after all, then programmers who tend to think in object-oriented terms are going to be much more familiar with manipulating such data.
That weaker consistency model helps programmers, tool, since their apps don't have to rigidly conform to data consistency requirements. That makes coding much simpler and (by extension) much faster.
Downtime? What Downtime?
Wiederhold's fourth example is a new one to the NoSQL advantage list. It's something that non-relational databases weren't specifically designed to do, but at which they've nonetheless turned out to be proficient.
Because of their distributed nature, Wiederhold says, NoSQL databases can be pretty much always on. This is a huge advantage for web- and mobile-based businesses that can't afford to be down for a single moment.
With some advanced planning, software updates and hardware upgrades can be performed while the database is still running hot. Try doing that with a relational database without taking it down, and you're in for a world of trouble.
get section where name = Conclusion
NoSQL databases' advantages sound great, and they are — for the right use case. If your company has a data set that will remain relatively constant in size, or that only grows slowly, you'll have little need to migrate to a non-relational system.
If sudden growth, agile development or high performance are something your organization will need for its data, then you should take a look at the NoSQL class of databases and see what might be a fit for you.
Image courtesy of Shutterstock