NoSQL databases grew in popularity for use in highly distributed web applications that needed scale-out architectures but didn’t require the tabular relations used by traditional SQL relational databases. Propelled initially by the development and adoption of NoSQL by technically savvy brands like Google, many developers eagerly adopted NoSQL and the use of low-level languages and traded off the benefits of SQL – standardization and programming efficiency — and data consistency. Most NoSQL databases are eventually consistent and don’t support ACID transactions, which for some web applications is a reasonable trade off. But nothing stands still. New SQL database offerings have caught up employing modern scale-out architectures, JSON support and in-memory performance, without sacrificing ACID guarantees. At the same time, NoSQL offerings are adopting SQL interfaces.
The two camps have evolved significantly, and the question still remains: When should you use a SQL-based database to solve your problem, and when should you turn to NoSQL?
SQL remains a popular choice and a proven solution when it comes to modern databases that handle large-volume analytic workloads and real-time transactions. Google, despite its early adoption of NoSQL, has shifted back to SQL for data consistency (see its F1 research). Facebook, Cloudera and Apache use SQL because they understand that it can meet user demands while managing constant interactions within massive amounts of data. By using SQL to deliver meaningful query optimization, these sites provide millions of users around the world with instant responses to their actions.
Applications using NoSQL databases, on the other hand, are usually simpler in their design, provide horizontal scalability, and deliver a mechanism for the storage and retrieval of data. For example, NoSQL solutions are ideal for archiving sensor readings or ad impression displays.
In this slideshow, VoltDB offers tips to help you decide which solution is better suited for your data needs.
Tips for Choosing the Right Database
Click through for tips to help you decide which database solution is better suited for your data needs, as identified by VoltDB.
Understand the problem.
The choice between SQL and NoSQL is not cut and dried, and the two are not in direct competition with each other. Many companies actually use both NoSQL and SQL solutions concurrently depending upon the use case and the desired end result. Focus on understanding the requirements, then determine the most appropriate solution.
Go for speed with SQL.
If you have gigabytes to terabytes of data that require high-speed transactions, a SQL database can ingest, analyze and make decisions in real time (in this case, milliseconds). Analytics and decisions are processed per request and not afterward in batch. For example, sensor, mobile phone and network access point data is often ideal for SQL databases. Using a SQL database to analyze data in real time enables rich transactions at scale, instant dataset-wide summaries and aggregation, and minimal application complexity. A SQL in-memory database like VoltDB offers high-speed ACID transactions with low-overhead indexing and materialized view support for fast lookup, response and decisioning.
For NoSQL, availability trumps correctness and ease of programming model.
A NoSQL database is an effective solution when you have gigabytes to petabytes of data, and you’re constantly adding new information. Once this information is added, it’s relatively static. For instance, application-to-database interactions are simple “CREATE” and “GET” patterns. The eventual-consistency algorithms allow implementations to deliver the highest availability across multiple data centers, while also adeptly scaling.
Use SQL for its standardization.
Because SQL is well-standardized, users have an ecosystem of management and operator tools to help design, monitor, inspect, explore and build apps on top of SQL systems. In addition, third-party tools enable enterprises to flow data between databases and systems. Within the core standardization of SQL, vendors also have the ability to specialize and introduce dialects into their SQL interfaces. This enables an ecosystem of management and operator tools to help design, monitor, inspect, explore and build applications on top of SQL systems.
Raw Storage Capacity
Use NoSQL for more raw storage capacity.
You might not need to get new information regularly, but if data scientists need to run arbitrary analyses against nearly unlimited data, a NoSQL solution is the best bet. In such a case, the data may or may not be structured but you’d prefer to specify a schema on read. NoSQL queries are implicitly batch-oriented and executed against historical data (rather than newly added data).