This article may be too technical for most readers to understand.(December 2023) |
NoSQL (originally referring to "non-SQL" or "non-relational")[1] is an approach to database design that focuses on providing a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Instead of the typical tabular structure of a relational database, NoSQL databases house data within one data structure. Since this non-relational database design does not require a schema, it offers rapid scalability to manage large and typically unstructured data sets.[2] NoSQL systems are also sometimes called "Not only SQL" to emphasize that they may support SQL-like query languages or sit alongside SQL databases in polyglot-persistent architectures.[3][4]
Non-relational databases have existed since the late 1960s, but the name "NoSQL" was only coined in the early 2000s,[5] triggered by the needs of Web 2.0 companies.[6][7] NoSQL databases are increasingly used in big data and real-time web applications.[8]
Motivations for this approach include simplicity of design, simpler "horizontal" scaling to clusters of machines (which is a problem for relational databases),[5] finer control over availability, and limiting the object-relational impedance mismatch.[9] The data structures used by NoSQL databases (e.g. key–value pair, wide column, graph, or document) are different from those used by default in relational databases, making some operations faster in NoSQL. The particular suitability of a given NoSQL database depends on the problem it must solve. Sometimes the data structures used by NoSQL databases are also viewed as "more flexible" than relational database tables.[10]
Many NoSQL stores compromise consistency (in the sense of the CAP theorem) in favor of availability, partition tolerance, and speed. Barriers to the greater adoption of NoSQL stores include the use of low-level query languages (instead of SQL, for instance), lack of ability to perform ad hoc joins across tables, lack of standardized interfaces, and huge previous investments in existing relational databases.[11] Most NoSQL stores lack true ACID transactions, although a few databases like MongoDB have made them central to their designs.[12]
Instead, most NoSQL databases offer a concept of "eventual consistency", in which database changes are propagated to all nodes "eventually" (typically within milliseconds), so queries for data might not return updated data immediately or might result in reading data that is not accurate, a problem known as stale read.[13] Additionally, some NoSQL systems may exhibit lost writes and other forms of data loss.[14] Some NoSQL systems provide concepts such as write-ahead logging to avoid data loss.[15] For distributed transaction processing across multiple databases, data consistency is an even bigger challenge that is difficult for both NoSQL and relational databases. Relational databases "do not allow referential integrity constraints to span databases".[16] Few systems maintain both ACID transactions and X/Open XA standards for distributed transaction processing.[17] Interactive relational databases share conformational relay analysis techniques as a common feature.[18] Limitations within the interface environment are overcome using semantic virtualization protocols, such that NoSQL services are accessible to most operating systems.[19]
NoSQL database, also called Not Only SQL
many advocates of NoSQL say that it does not mean a "no" to SQL, rather it means Not Only SQL