NoSQL vs. SQL: It’s About the Performance and Scale

By on

Learn more about Dale Kim.

toolsIf you’re an application developer with years of experience in relational database management systems (RDBMS) and SQL, you might still use those trusted technologies for most of your application needs. But you might be hearing a lot about NoSQL databases, and how they can be a better fit for your specific situations. While you might continue to be happy with your RDBMS, consider some of the advantages you get with a NoSQL database; especially when working with large volumes of data with varying structures.

Why NoSQL?

There has been a lot of buzz on tech blogs and industry journals with strong opinions both for and against NoSQL. The debates come in many forms. One way to summarize them entails describing the trade-offs you’ll make to accomplish your application development goals. For example, your primary requirement might be system reliability. So, on one hand, you can use a proven technology with solid enterprise-grade features in your RDBMS, and make the data fit the relational model. On the other hand, you can store the data in a more natural model, but you’re delving into new technologies and wandering away from your expertise and the best practices you’ve learned over the years. And what about the multi-row transactional support that is missing in most NoSQL technologies? How can you develop applications without that?

The first option of sticking with RDBMSs remains attractive, especially since there are numerous tools in the RDBMS ecosystem to help manage the various data types used in enterprises today. If, for example, you’re working with a combination of product data, social media data, and sales data in the same application, you can use object-relational mapping (ORM) tools to simplify the process of modeling complex data into RDBMS tables. That tends to work well, so there doesn’t appear to be much of a trade-off. However, in many situations, the complex SQL generated by your ORM tools can create a significant performance drain. While some performance issues might not show up in smaller environments, with sources like social media (with data that continually grows), you will soon put a heavy load on your RDBMS, and your users will suffer a performance hit. Also, it’s important to recognize early that your production loads will be quite different from those of your smaller test environment, so satisfactory performance during a testing stage might not extrapolate to a production environment.

Certainly, the performance hit could be overcome with more powerful hardware, but the ongoing upgrade process of your hardware is the exact issue that NoSQL databases will solve. Instead of having to purchase new servers with more memory, NoSQL databases support a scale-out model where you can simply add new servers to the cluster. This allows you to grow incrementally without having to replace your existing hardware investment. This benefit alone makes it worthwhile to consider NoSQL for many of your modern use cases.

What about multi-row transactional support? Many use cases today don’t require updating multiple rows and multiple tables in a transactionally guaranteed manner (i.e., as ACID transactions), which is why NoSQL will work well. And, since NoSQL systems typically use a denormalized data model in which all information about an entity is in a single record, there often is no need to update multiple rows.

One example of a job that’s well-suited to NoSQL is capturing data from sensors as part of an Internet-of-things setup. A small weather station captures a lot of data, such as rainfall, wind speed, and atmospheric pressure. Imagine a network with hundreds or thousands of these stations spread out across a given area, all running 24/7. As the data grows, you can incrementally expand your NoSQL cluster, and for this environment you don’t have to worry about transactional support.

Why Not NoSQL?

With the performance, scale, and flexibility advantages of NoSQL, will it replace your RDBMS? Not in the near future. Until NoSQL databases can be a drop-in replacement for RDBMSs, which probably won’t happen for many years to come, you will continue using your RDBMS for many of your enterprise business applications.

You shouldn’t outright drop your RDBMSs since that’s where many of your business needs lie. Instead, pay close attention to potential scaling challenges. If your data isn’t growing at unpredictable rates, or you need multi-row transactional support (such as in a credit/debit system), then RDBMSs are the technology of choice. On the other hand, with the emerging use cases that take advantage of NoSQL, now is a good time to investigate NoSQL and pick up a new skillset that will increase in demand. Specific types of NoSQL databases like JSON-based document databases are especially easy to work with, so learning more about them will be valuable to you. It’s not hard to imagine that the future in-demand application developer will have proficiency in both RDBMSs and NoSQL.

Leave a Reply