In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the advantages and disadvantages of Mysql paradigm and anti-paradigm". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the pros and cons of Mysql paradigm and anti-paradigm?"
One and three paradigms
The first paradigm
1NF is the atomicity of attributes, which requires attributes to be atomicity and can not be decomposed again.
The first paradigm is the most basic paradigm. If all the field values in the database table are indecomposable atomic values, the database table satisfies the first normal form. Each column of a database table is an indivisible atomic data item, not a collection, array, record, or other non-atomic data item. In short, the first paradigm is a domain without repetition.
The second paradigm
2NF is the uniqueness of the record, which requires the record to have a unique identity, that is, the uniqueness of the entity, that is, there is no partial dependence.
To meet the second paradigm, we must first meet the first paradigm. The second paradigm needs to ensure that each column in the database table is related to the primary key, not only to some part of the primary key (mainly for the federated primary key). That is to say, in a database table, only one kind of data can be saved in a table, and multiple data can not be saved in the same database table.
The third paradigm
3NF is the redundancy of the field, which requires that no field can be derived from other fields. It requires that the field has no redundancy, that is, there is no transitive dependency.
The first is 2NF, and non-primary key columns must be directly dependent on the primary key, and there can be no transitive dependencies. That is, it cannot exist: non-primary key column A depends on non-primary key column B, and non-primary key column B depends on primary key. In short, the third normal form (3NF) requires that a relationship does not contain non-primary keyword information that is already contained in other relationships. For example, there is a department information table in which each department has a department number (dept_id), department name, department profile, and so on. Then after the department number is listed in the employee information table, the department name, department profile and other department-related information can no longer be added to the employee information table.
Pros and cons of the paradigm:
Advantages: the paradigm can avoid data redundancy, reduce the space of the database, and reduce the trouble of maintaining data integrity.
Disadvantages: tables designed according to the specification of the normal form, the higher the level of the paradigm, the more tables are designed. For example, the table that may be designed by the first paradigm may have only one table, and when designing this table according to the second normal form, there may be two or more tables. If you design this table according to the third paradigm or higher paradigm, there will be more tables than the second normal form. The more the number of tables, when we go to query some data, we must go to multiple tables to query the data, so the query time is much higher than the time spent in a table query. In other words, the higher the paradigm we use, the lower the performance for data manipulation. So when we use the paradigm to design the table, we have to weigh whether to use a higher paradigm to design the table according to the specific requirements.
Second, anti-paradigm
Therefore, the name implies that, contrary to what the paradigm requires, in the anti-paradigm design pattern, we can allow appropriate data redundancy and use this redundancy to shorten the time to manipulate the data. In other words, space is traded for time, data is redundant in multiple tables, and the association between tables can be reduced or avoided when querying.
Pros and cons of anti-paradigm:
Advantages: it can reduce the association of tables when querying; it can optimize the index better.
Disadvantages: data redundancy and abnormal data maintenance; modification of data requires more cost
Thank you for your reading. the above is the content of "what are the advantages and disadvantages of Mysql paradigm and anti-paradigm". After the study of this article, I believe you have a deeper understanding of the pros and cons of Mysql paradigm and anti-paradigm, and the specific use needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.