In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about the comparison between structured SQL database and unstructured NOSQL database. Many people may not know much about it. In order to make you understand better, the editor summarizes the following content for you. I hope you can get something according to this article.
Hello, everyone, let's talk about databases. At present, there are two types of databases, one is structured SQL database, one is unstructured NOSQL database.
Competition 1: the organization of data.
SQL
SQL, as its name implies, is a structured query language. Its data is structured, which needs to be designed when the database is first created. Once the design is finalized, it will be troublesome to modify it. Of course, if the design is well done, there is no need to modify it. So one of the jobs of structured data is the design of tables. This is a top priority in the development work when using such a database.
Another embodiment of structured data is the relationship between all kinds of data, such as one-to-one relationship, one-to-many relationship, many-to-many relationship.
Another manifestation is that the definition of data is strict, only one kind of table data can be stored in a table, that is, your data in each row should follow the definition of this table. Each row of data in this table follows the data type defined in this table, and some so-called non-defined data cannot be stored, otherwise something will go wrong.
NOSQL
And the NOSQL database. It does not require structured data design. In this way, its fault tolerance is very strong, and there is no too strict design, so it is easier to expand and modify in the future.
There is no concept of relationship in NOSQL database. If you want to implement a relationship, such as one-to-one, one-to-many, many-to-many, you need to implement it programmatically, not with the database itself.
The other is that different data types can be stored in a table, which simply means that each row of data can not follow a uniform definition.
Competition 2: atomic operation
We need to look at atomic operations. The so-called atomic operation means that an operation either succeeds or fails, and there is no halfway end. Suppose there are five steps in an order processing operation, you process an order, submit the order, start calculating the data, and then write five tables in the database before returning success. If there is a failure, return failure. A failure to return means to undo all previous operations.
This kind of atomic operation is very easy to implement in SQL database, and it has such a mechanism called transaction mechanism.
This is also an important reference index for us to choose SQL database. As long as we have such an operation in the process of processing the data, either success or failure, then the first thing we have to choose is the SQL database.
However, such a mechanism does not exist in NOSQL databases. But here the pursuit of data unity, for example, you have a lot of data sets, here do not call it a data table. Once some changes are made, you must update all datasets that contain such data.
Competition 3: efficiency.
There are many ways to improve the efficiency of data processing in structured database. For example, create an index, use the stored program Stored Procedure, and some schemas such as entity framework, hibernate.
However, because the structured database naturally pursues data integrity, there are still some bottlenecks in its efficiency.
However, there is no such problem in NOSQL unstructured databases. Because it is concerned with writing data quickly and querying data. Although there is some data redundancy, its writing and query speed is very fast, especially when dealing with huge amounts of data.
But if the coupling between data sets is very strong, because to achieve data unity, you need to constantly write multiple related data sets, which will greatly reduce efficiency.
Competition 4: expansion potential
The difference between horizontal expansion and vertical expansion.
Scale-out refers to using multiple servers to serve a database, and the advantage of this expansion is that there is no limit. This is almost impossible for a structured database. Unstructured databases can scale out.
Vertical scaling refers to improving the performance of the overall server by improving the performance of hardware and software. The disadvantage of this expansion is that it always reaches its limit. Of course, this extension is applicable to both structured and unstructured databases.
To be honest, it's hard to say, is a structured database better or an unstructured database better? Because the original intention of the design of these two kinds of databases is different.
The goal of structured database is to pursue the integrity of data operations, but the performance requirements of stand-alone servers are relatively high.
The design of unstructured database pursues the efficiency and expansibility of reading and writing, and can realize the cooperation of multiple computers. But it does not pay attention to the integrity of data operation. At the same time, it will produce a lot of redundant data.
After reading the above, do you have any further understanding of the comparison between structured SQL databases and unstructured NOSQL databases? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.