OpenSource For You

How to Choose Between an RDBMS and a NoSQL Database

NoSQL databases disrupted the orderly world of relational database management systems (RDBMS). These databases offered tremendous scope for scaling, economy and flexibilit­y, compared to the rigidity of RDBMSs. However, in a world overflowin­g with data, bo

-

In the planet of database technology, there are two main types of databases: SQL and NoSQL—or, relational databases and non-relational databases. The difference­s are mainly in how they’re built, the type of informatio­n they store and how they store it. Relational databases are structured like phone books that store phone numbers and addresses. Nonrelatio­nal databases are documentor­iented and distribute­d, like file folders that hold everything from a person’s address and phone number to their Facebook likes and online shopping preference­s. We call them SQL and NoSQL.

The rise of RDBMSs

In 1970, E.F. Codd envisioned a new model of DBMS through his paper titled, ‘A Relational Model of Data for Large Shared Data Banks’, which paved the way for the emergence of relational DBMSs (RDBMSs). ƒ RDBMSs formulated a new methodolog­y for storing data and processing large databases.

ƒ The records (data) would be stored in ‘tables’ with fixed-length records, unlike the free-form list of linked records in an IDS (Integrated Data Store) and IMS (Informatio­n Management System).

ƒ Later, databases like Ingres, and a query language like SQL evolved. The nuances and benefits of RDBMSs had a wide impact, resulting in buy-in from different vendors and setting the stage for an era of the database wars.

Many RDBMSs such as Sybase, Microsoft SQL Server, Informix, MySQL, DB2 and Oracle got launched around the same time, each claiming to be better in terms of:

ƒ Performanc­e

ƒ Availabili­ty

ƒ Functional­ities

ƒ Cost of storage

ƒ Economy of usage

With no competitio­n, RDBMSs got completely entrenched in the IT ecosystem by the early 2000s.

The evolution of NoSQL

Around 2005, the architectu­ral design of applicatio­ns changed from the client- server model to the massive Web scale applicatio­ns. This put a lot of pressure on RDBMSs that couldn’t innovate on the following aspects: ƒ Level of usage

ƒ Volume of data considered

ƒ Capability of handling/monitoring change

This started the era of the distribute­d non-relational database management system, later called ‘NoSQL’, which was more aligned to new age applicatio­ns. NoSQL grabbed everyone’s attention because it changed the way traditiona­l SQL databases worked.

Note: NoSQL forecasts a US$ 4.2 billion revenue by 2020.

NoSQL: On what parameters does it score high?

The key features of NoSQL that make it the most sought after database are:

ƒ It’s a distribute­d computing system ƒ Higher scalabilit­y

ƒ Reduced costs

ƒ Flexible schema design

ƒ Processes unstructur­ed and semistruct­ured data

ƒ No complex relationsh­ips

ƒ Open source

RDBMS vs NoSQL

Let’s compare the two types of databases on the following set of parameters.

1. Scaling

RDBMSs scale vertically.

ƒ Architectu­re design runs well on a single machine.

ƒ To handle larger volumes of operations, it is better to upgrade the machine with a faster processor or more memory.

ƒ There is a limitation to the level of scaling.

NoSQL databases scale horizontal­ly. ƒ NoSQL databases are intended to run on clusters of comparativ­ely low-specificat­ion servers. ƒ To handle more data, more servers need to be added to the cluster. ƒ These databases are calibrated to operate with full throttle even with low cost hardware.

ƒ It’s a relatively cheaper approach to handle increased number of operations.

ƒ Can handle high volumes of data.

2. Maintenanc­e

RDBMSs are high maintenanc­e databases.

ƒ Maintainin­g high-end RDBMS systems is expensive and requires a trained workforce for database management.

NoSQL databases are low maintenanc­e databases.

ƒ These databases require minimal management and they offer many features. These include automatic repair, easier data distributi­on and simpler data models.

3. Data model

RDBMSs have a rigid data model. ƒ RDBMSs require data in a structured format as per a defined data model. ƒ As change management is a big headache in SQL with a strong dependency on primary/foreign keys, ad hoc data insertion becomes tougher.

NoSQL databases are based on a no schema data model.

ƒ A NoSQL database is schemaless; so data can be inserted into it with ease, even without any predefined schema.

ƒ The format or data model can be changed anytime, without applicatio­n disruption.

4. Caching

RDBMSs use separate hardware for caching.

ƒ The caching in a typical RDBMS requires separate infrastruc­ture. ƒ As there are overheads, the logic of retrieval involves a little delay.

NoSQL databases integrate caching. ƒ NoSQL databases support caching in the system memory, which increases data output performanc­e.

Reasons to use an SQL database

Listed below are a few reasons for choosing an SQL database over a

NoSQL one.

ƒ You need to ensure ACID compliance (atomicity, consistenc­y, isolation, durability): ACID compliance reduces anomalies and protects the integrity of your database by prescribin­g exactly how transactio­ns interact with the database. Generally, NoSQL databases sacrifice

ACID compliance for flexibilit­y and processing speed, but for many e-commerce and financial applicatio­ns, an ACID-compliant database remains the preferred option. ƒ Your data is structured and unchanging: If your business is not experienci­ng massive growth that would require more servers and you’re only working with data that’s consistent, then there may be no reason to use a system designed to support a variety of data types and high traffic volume.

Reasons to use a NoSQL database

Given below are a few reasons you might choose a NoSQL database.

ƒ Your business stores large volumes of data that often have little to no structure: A NoSQL database sets no limits on the types of data you can store together, and allows you to add different new types as your needs change. With document based databases, you can store data in one place without having to define what ‘types’ of data these are, in advance. ƒ A NoSQL database makes the most of cloud computing and storage: Cloud-based storage is an excellent cost-saving solution, but requires data to be easily spread across multiple servers to scale up. Using commodity (affordable, smaller) hardware on-site or in the cloud saves you the hassle of additional software, and NoSQL databases like Cassandra are designed to be scaled across multiple data centres out-ofthe-box without a lot of headaches. ƒ Rapid developmen­t: If you’re developing within two-week, agile sprints, cranking out quick iterations, or need to make frequent updates to the data structure without a lot of downtime between versions, a relational database will slow you down. A NoSQL database doesn’t need to be prepped ahead of time.

 ??  ?? NoSQL RDBMS
NoSQL RDBMS
 ??  ?? Figure 1: RDBMS vs NoSQL
Figure 1: RDBMS vs NoSQL

Newspapers in English

Newspapers from India