In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-14 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 difference between relational database and non-relational database. Many people may not know much about it. In order to make you understand better, the editor summarized the following contents for you. I hope you can get something from this article.
The relational model refers to the two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and their relationships. The following is to introduce and understand relational database by briefly introducing the advantages and disadvantages of relational database.
Advantages of Relational Database
Easy to understand: two-dimensional table structure is a concept that is very close to the logical world
Easy to use: the general SQL language makes it very convenient to operate relational databases.
Easy to maintain: rich integrity greatly reduces the probability of data redundancy and data inconsistency
Bottleneck: high concurrent read and write requirements: the concurrency of users of the website is very high, often reaching tens of thousands of read and write requests per second. For traditional relational databases, the hard disk Iripo is a big bottleneck; efficient reading and writing of massive data: the amount of data generated by the website every day is huge, and for relational databases, querying in a table containing massive data is very inefficient. High scalability and availability: in the web-based structure, the database is the most difficult to scale out. When the number of users and visitors of an application system is increasing day by day, the database has no way to expand the performance and load capacity as easily as webserver and appserver by adding more hardware and service nodes. For many websites that need to provide round-the-clock service, it is very painful to upgrade and expand the database system, which often requires downtime maintenance and data migration.
The Application defect of Relational Database similar to web
Transaction consistency: relational databases have a lot of overhead in maintaining the consistency of things, but now many web2.0 systems do not have high consistency in reading and writing things, and transaction consistency is not so important.
Real-time reading and writing: the huge price paid by relational databases to maintain consistency is their poor reading and writing performance. For relational databases, it is certain that this piece of data can be read out immediately after inserting a piece of data, but for many web applications, it does not require such high real-time performance, and the ability to read and write concurrently is so high that relational databases cannot cope with it. A new data structure storage must be used to replace the relational database.
Fixed table structure: poor expansibility, system upgrade, the increase of functions, often means great changes in the data structure, which is difficult for relational databases to cope with, requiring new structured data storage.
Complex SQL, especially multi-table association query: any web system with a large amount of data is very taboo to the association query of multiple large tables and the complex SQL report query of complex data analysis type, which avoids this situation from the point of view of demand and product class. Often more is only a single table primary key query, and a single table simple conditional paging query, the function of SQL is greatly weakened.
Non-relational database: used to refer to data storage systems that are non-relational, distributed, and generally not guaranteed to follow ACID principles.
Non-relational database puts forward another idea, for example, key-value pairs are stored, and the structure is not fixed, each tuple can have different fields, and each tuple can add some of its own key-value pairs as needed. in this way, it is not limited to a fixed structure, and can reduce some time and space overhead. In this way, users can add the fields they need according to their needs, so that in order to obtain different information about users, there is no need to associate multiple tables with queries like in relational databases. You only need to pull out the corresponding value according to the id to complete the query. However, due to few constraints, the non-relational database is also unable to provide a query for field attribute values like the where provided by SQL. And it is difficult to reflect the integrity of the design. It is only suitable for storing some relatively simple data, and the relational database is more suitable for the data that needs to be queried more complex.
Note: database transactions must have ACID characteristics, ACID is Atomic atomicity, Consistency consistency, Isolation isolation, Durability persistence.
Relational databases compare the advantages of relational databases with non-relational databases:
1. Complex query can easily do very complex data query between one table and multiple tables with SQL statement.
two。 Transaction support enables data access requirements with high security performance to be realized. For these two types of databases, each other's advantage is its own weakness, and vice versa.
Advantages of non-relational databases:
1. Performance NOSQL is based on key-value pairs, which can be thought of as the correspondence between primary keys and values in the table, and does not need to be parsed by the SQL layer, so the performance is very high.
two。 Scalability is also because there is no coupling between data based on key-value pairs, so it is very easy to scale horizontally.
Non-relational database classification; except for some commonalities, a large part of them are aimed at some specific application requirements, so it has extremely high performance for this kind of applications. According to the different structured methods and applications, they are mainly divided into the following categories:
Key-value databases for high-performance concurrent read and write:
The main characteristics of key-value database, even if it has very high concurrent read and write performance, Redis,TokyoCabinet,Flare is the representative of this kind.
Document-oriented database for massive data access:
The characteristic of this kind of database is that it can query data quickly in a large amount of data, typical representatives are MongoDB and CouchDB.
Extensibility-oriented distributed database:
The problem that this kind of database wants to solve is that the traditional database has the defect of expansibility, which can adapt to the increase of the amount of data and the change of data structure.
After reading the above, do you have any further understanding of the difference between relational databases and non-relational 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.