Learned so many NoSQL databases! What exactly is NoSQL?

Time:2022-11-25

Article content: After learning so many NoSQL databases, what is NoSQL?

author:optimal limit

Learned so many NoSQL databases! What exactly is NoSQL?

A brief history of NoSQL

The term NoSQL first appeared in 1998. It is a lightweight, open source relational database that does not provide SQL functions developed by Carlo Strozzi.

In 2009, Johan Oskarsson of Last.fm initiated a discussion about distributed open source databases. Eric Evans from Rackspace once again proposed the concept of NoSQL. At this time, NoSQL mainly refers to non-relational, distributed databases that do not provide ACID. Design Patterns.

A milestone was the “no:sql(east)” symposium in Atlanta in 2009, with the slogan “select fun, profit from real_world where relational=false”. Therefore, the most common interpretation of NoSQL is “non-relational”, emphasizing the advantages of Key-Value Stores and document databases, rather than simply opposing RDBMS.

What is NoSQL

Learned so many NoSQL databases! What exactly is NoSQL?

  NoSQL(Not Only SQL),meaning is”not just SQL“, refers to non-relational databases, and is a general term for database management systems that are different from traditional relational databases.

NoSQL is used for the storage of very large-scale data. These types of data stores do not require a fixed schema and can scale out without redundant operations.

Why use NoSQL

With the rapid development and popularization of the Internet, the data generated by netizens when surfing the Internet is also increasing day by day, ranging from GB to TB to PB. A large part of this data is processed by a relational database management system (RDBMS).

Due to the paradigm constraints, transaction characteristics, disk IO and other characteristics of relational databases, if the server uses a relational database, when a large amount of data is generated, the traditional relational database can no longer meet the needs of fast query and data insertion. The emergence of NoSQL solves this crisis. It obtains performance improvement by reducing data security, reducing support for transactions, and reducing support for complex queries. However, NoSQL is still not the best candidate in some specific scenarios, such as some scenarios that absolutely require transaction and security indicators.

NoSQL is a brand new revolutionary movement in databases, it was proposed in the early days, and the trend of development to 2009 became more and more high. Supporters of NoSQL advocate the use of non-relational data storage. Compared with the overwhelming use of relational databases, this concept is undoubtedly a new injection of thinking.

RDBMS vs. NoSQL

Learned so many NoSQL databases! What exactly is NoSQL?

common database management systems

according toDB-Engineshttps://db-engines.com/en/ran…The ranking of the ranking, this article intercepts the ranking Top 50 as shown in the figure below. The DB-Engines ranking ranks database management systems according to their popularity. The ranking is updated monthly.

Learned so many NoSQL databases! What exactly is NoSQL?

Four families of NoSQL databases

Key-value storage

  features: Key-value databases are like hash tables used in traditional languages. Add, query or delete data by Key.

  advantage: The query speed is fast.

  shortcoming: The data is unstructured and usually only stored as string or binary data.

  Application Scenario: Content cache, user information such as sessions, configuration information, shopping cart, etc., mainly used to handle high access loads of large amounts of data.

  NoSQL stands for:Redis、Memcached…

Document (Document-Oriented) storage

  features: The document database stores data in the form of documents, similar to JSON, which is a collection of a series of data items. Each data item has a name and a corresponding value, and the value can be a simple data type, such as a string, a number, and a date, etc.; it can also be a complex type, such as an ordered list and an associated object.

  advantage: The data structure requirements are not strict, the table structure is variable, and there is no need to pre-define the table structure like a relational database.

  shortcoming: The query performance is not high, lacking a unified query syntax.

  Application Scenario: logs, web applications, etc.

  NoSQL stands for:MongoDB、CouchDB…

Column (Wide Column Store/Column-Family) storage

  features: The column storage database stores data in a column family (Column Family), aggregates multiple columns into a column family, and the keys still exist, but they are characterized by pointing to multiple columns. For example, if we had a Person class, we’d usually query their name and age together instead of salary. In this case, name and age would be placed in one column family and salary in another.

  advantage: Column storage has fast search speed, strong scalability, and easier distributed expansion. It is suitable for distributed file systems and handles massive data in distributed storage.

  shortcoming: The query performance is not high, lacking a unified query syntax.

  Application Scenario: Logs, distributed file systems (object storage), recommended portraits, spatio-temporal data, messages/orders, etc.

  NoSQL stands for:Cassandra、HBase…

Graph-Oriented storage

  features: Graph databases allow us to store data in graphs.

  advantage: Graph related algorithms. Such as shortest path addressing, N-degree relationship search, etc.

  shortcoming: In many cases, it is necessary to calculate the entire graph to obtain the required information. Distributed cluster solutions are not easy to implement, the processing of super nodes is weak, there is no fragmentation storage mechanism, and the domestic community is not active.

  Application Scenario: social networks, recommender systems, etc. Focus on building the relationship graph.

  NoSQL stands for:Neo4j、Infinite Graph…

Pros and Cons of NoSQL

advantage

  • high scalability
  • no standardization
  • Distributed Computing
  • limited query capabilities (so far)
  • low cost

shortcoming

  • Eventual consistency is an unintuitive program
  • Schema flexibility, semi-structured data
  • no complicated relationship

Summarize

NoSQL databases are suitable in the following situations:

  • The data model is relatively simple
  • Need for more flexible IT systems
  • High requirements on database performance
  • Does not require a high degree of data consistency
  • Environments where it is easier to map complex values ​​for a given Key

Thank you for your recognition and support, the editor will continue to repost “optimal limit》Quality Articles