Basic knowledge about NoSQL Databases
This article is from: NoSQL database getting started. For details about how to download the PDF version, see
What is NoSQL?
Have you heard of NoSQL? In recent years, this word has received a lot of attention. When you see the word "NoSQL", you may mistakenly think it is "No! The abbreviation of SQL is deeply angry: "How can SQL be unnecessary ?" But in fact, it is the abbreviation of "Not Only SQL. Its significance is: when it is applicable to relational databases, it uses relational databases. When it is not applicable, there is no need to use non-relational databases. You can consider using more suitable data storage.
To make up for the shortcomings of relational databases, a variety of NoSQL databases emerged.
To better understand the NoSQL database introduced in this book, it is essential to understand relational databases. So let's take a look at the history, classification, and features of relational databases.
A Brief History of relational databases
In 1969, Edgar Frank Codd published an epoch paper that first proposed the concept of a relational data model. Unfortunately, the IBM Research Report published in the paper is only an internal publication of IBM, so the paper has a moderate response. In 1970, he again published A paper entitled "A Relational Model of Data for Large Shared Data banks" in the publication "Communication of the ACM, it finally attracted everyone's attention.
The concept of the relational data model proposed by cod has become the foundation of today's relational databases. At that time, relational databases were not put into practical use due to poor hardware performance and slow processing speed. However, with the improvement of hardware performance and the advantages of simple use and superior performance, relational databases have been widely used.
Versatility and High Performance
Although this book explains NoSQL databases, there is an important premise that you must not misunderstand. The premise is that "the performance of a relational database is definitely not low, it has very good versatility and very high performance ". Undoubtedly, it is the most effective solution for most applications.
Outstanding advantages
As a widely used general-purpose database, relational databases have the following outstanding advantages:
- Maintain data consistency (Transaction Processing)
- Due to the premise of standardization, the overhead of data update is very small (the same field basically only has one)
- Supports complex queries such as JOIN.
- There are many practical achievements and professional technical information (mature technologies)
In this case, maintaining data consistency is the biggest advantage of relational databases. When strict data consistency and processing integrity need to be ensured, there is certainly no error in using a relational database. However, in some cases, JOIN is not required, and there is no special need for the advantages of the above relational database. In this case, it seems that there is no need to stick to the relational database.
Lack of relational databases
Not good at Processing
As mentioned earlier, the performance of relational databases is very high. However, it is a general-purpose database and cannot fully adapt to all purposes. Specifically, it is not good at the following:
- Writing a large amount of data
- Index or schema change for tables with data updates
- Apply when the field is not fixed
- Quick Response to simple queries
......
NoSQL Database
To make up for the shortcomings of relational databases (especially in recent years), NoSQL databases have emerged. Relational databases are widely used for complex processing such as transaction processing and JOIN. Comparatively, NoSQL databases are only applied in specific fields and basically do not carry out complex processing, but they just make up for the shortcomings of the previously listed relational databases.
Easy Data Distribution
As mentioned above, relational databases are not good at writing large amounts of data. Originally, relational databases were created on the premise of JOIN. That is to say, the association between data is the main reason why relational databases get their names. For JOIN Processing, relational databases have to store data on the same server, which is not conducive to data dispersion. On the contrary, NoSQL databases originally do not support JOIN Processing, and each data is independently designed to easily distribute data to multiple servers. Because the data is distributed to multiple servers, the data volume on each server is reduced. Even if a large amount of data is written, the processing is easier. Likewise, Data Reading is certainly equally easy.
Improved performance and increased scale
The following is an aside. If you want the server to easily process a large amount of data, there are only two options: Performance Improvement and scale-up. Let's sort out the differences between the two.
First, improving the performance refers to improving the processing capability by improving the performance of the current server. This is a very simple method, and the procedure does not need to be changed, but it requires some fees. If you want to purchase a server that doubles the performance, the cost is usually not only twice the original cost, but may be up to 5 to 10 times. This method is simple but costly.
On the other hand, increasing the scale means using multiple cheap servers to improve processing capabilities. It needs to change the program, but the cost can be controlled due to the use of cheap servers. In addition, you only need to add the number of cheap servers in the future.
Isn't it necessary to process a large amount of data?
NoSQL databases are basically designed to make writing and processing of large amounts of data easier (making it easier to increase the number of servers. However, if you do not operate on a large amount of data, will NoSQL database applications be meaningless?
The answer is no. Indeed, it has advantages in processing large amounts of data. However, in fact, NoSQL databases also have various features. It would be helpful to make proper use of these features. The specific examples will be introduced in chapter 2nd and Chapter 3rd, which will help you feel the benefits of using NoSQL.
- We hope to smoothly Cache data for processing.
- You want to process data of the array type at a high speed.
- Save all
Diverse NoSQL Databases
NoSQL databases have various types such as "key-value storage", "document-type Database", and "column storage database". Each type of database has its own characteristics. Next, let's take a look at the types and features of NoSQL databases.
For more details, please continue to read the highlights on the next page: