In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
What is the difference between relational database and non-relational database? I believe many inexperienced people are at a loss about it. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
1. Relational database establishes the relationship between table and table through foreign key association, 2. A non-relational database usually means that data is stored in the database in the form of objects, and the relationship between objects is determined by the properties of each object.
For example, there is a student's data:
Name: Zhang San, gender: male, student number: 12345, class: class 1, Grade 2
There is also data from one class:
Class: class 1, Grade 2, head teacher: Li Si
In the relational database, we create a student table and a class table to store these two pieces of data, and the class in the student table stores the primary key in the class table.
In the non-relational database, we create two objects, one is the student object and the other is the class object, which is represented by java:
Class Student {
String id
String name
String sex
String number
String classid
}
Class Grade {
String id
String name
String teacher
}
Establish this relationship by setting the classid of the Student class to be equal to the id of the Grade class
In a non-relational database, we query a piece of data and get an array of results. In a relational database, the result of querying a piece of data is an object.
Database
Advantages and disadvantages of type characteristics
Relational database
SQLite, Oracle, mysql1, and relational databases refer to the use of relational models to organize
Database of data
2. The most important feature of relational database is the consistency of transactions.
3. To put it simply, a relational model refers to a two-dimensional tabular model.
A relational database is a data organization composed of two-dimensional tables and their relationships. 1. Easy to understand: two-dimensional table structure is a concept very close to the logical world, and the relational model is easier to understand than other models such as mesh, hierarchy and so on.
2. Easy to use: the general SQL language makes it very convenient to operate relational databases.
3. Easy to maintain: rich integrity (physical integrity, referential integrity, and user-defined integrity) greatly reduces the probability of data redundancy and data inconsistency
4. Support SQL, which can be used for complex queries. 1. The huge price paid for maintaining consistency is its poor reading and writing performance.
2. Fixed table structure
3. High concurrent read and write requirements
4. Efficient reading and writing of massive data
Non-relational database
MongoDb, redis, HBase1, using key-value pairs to store data
2. Distributed
3. Generally, ACID is not supported.
4. Strictly speaking, non-relational database is not a kind of database, but a collection of structured data storage methods. 1. There is no need to parse in the sql layer, and the read and write performance is very high.
2. Based on the key-value pair, the data is not coupled and is easy to expand.
3, storage data format: nosql storage format is key,value form, document form, picture form and so on, document form, picture form and so on, while relational database only supports basic types. 1. Without sql support, the cost of learning and using is high.
2. No transaction processing, and poor support for additional functions such as bi and reports.
Note 1: database transactions must have ACID characteristics, ACID is Atomic atomicity, Consistency consistency, Isolation isolation, Durability persistence.
Note 2: the persistent storage of data, especially the persistent storage of massive data, still needs a relational database.
After reading the above, have you mastered the difference between relational database and non-relational database? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.