The push for ever-greater data management and analytics capabilities has led to an increase in the use of NoSQL databases. The technology offers many advantages, including scalability, performance, and flexibility. However, these advantages translate into difficulties protecting applications that run atop NoSQL databases. Traditional snapshot approaches don’t work very well. New approaches to database backup have emerged, though, that make it possible to protect data in NoSQL databases.
NoSQL, as its name implies, refers to database management systems (DBMSs) that do not use Structured Query Language (SQL), which has been the standard for most commercial databases since the 1980s. Microsoft SQL Server, Oracle, IBM DB2 and MySQL are popular examples. SQL relational databases suffer from a lack of horizontal scalability and rigidity that comes from the table designs in relational systems. The NoSQL approach gets around these problems.
There are now many types of NoSQL databases on the market today. These include simple “key-value” databases as well as sophisticated suites like MongoDB. MongoDB is an open-source NoSQL DBMS that uses flexible documents to store and process multiple types of data, rather than structured tables. The documents are formatted in Java Script Object Notation (JSON). With this approach, they can distribute heterogeneous datasets across more than one system.
NoSQL users are able to work with virtually any data type due to the technology’s elastic data model. The results are simplified database management, which developers tend to like, and a highly scalable database that creates a highly available and high-performing environment to support applications. This appeals to database administrators (DBAs) and infrastructure managers.
Conventional incremental backup methods are not effective for NoSQL databases. There are a number of reasons for this, including the distributed, scaled-out nature of most NoSQL database instances. They store data in different places, often with rates of data change varying greatly from one part of the database to another.
A typical NoSQL instance supporting an application has a very large data set with a high rate of change. Periodic snapshots will typically fail to capture all that’s required for a reliable Recovery Time Objective (RTO). Also, if data is compromised, the snapshot will restore corrupted data. Built-in replication functions won’t help, either. They may simply replicate corrupted data.
The other major backup issue with NoSQL databases relates to their lack of compliance with the principle of atomicity, consistency, isolation, and durability (ACID). The ACID transaction model, which is standard for SQL databases, ensures the integrity of the database by making any change in one part of the database be consistent and durable across the entire database.
For example, in an ACID-compliant database, if two users attempt to perform operations that will affect the same data, e.g., two people trying to buy a single copy of a book, the database will isolate the transactions so they occur one at a time. One person will get the single copy of the book. The other will be told it’s out of stock. Without ACID, both people could buy the same book and the database would have no way of reconciling the inconsistency.
Conventional backup solutions are built to work with the ACID transaction model. As a result, they cannot create an accurate “point-in-time” backup of a NoSQL database. A further complication emerges from the fact that many modern apps running atop NoSQL are “always on.” The database cannot be “quiesced” for a backup. Most NoSQL databases use an approach of “eventual consistency” in place of ACID. This makes the database faster and easier to scale, but it requires a lot of time and repairs to recover if there is a failure. This is not good for RTOs.
It is possible to back up a NoSQL database. Solutions, as exemplified by Rubrik Mosaic, deliver app-consistent backups for NoSQL databases using a policy-driven approach. Mosaic streams data from NoSQL database clusters in parallel, so the backups can be stored anywhere, in public cloud infrastructure, private clouds, or Network Attached Storage (NAS). This approach enables a “forever” incremental backup without having to quiesce the NoSQL database and the app it supports. Protection is granular, so backup and recovery can occur at the levels of the database as a whole or individual tables.
Learn more about how Rubrik can help you protect apps running on NoSQL databases with Rubrik Mosaic.