Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the advantages and disadvantages of DSM

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the advantages and disadvantages of DSM". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the advantages and disadvantages of DSM?"

NSM vs DSM

The NSM:N meta-storage model, that is, the row storage model. The physical structure of the data is the same as their logical structure. The disk is made up of a block, so continuous data is divided into contiguous block. The correspondence between logic and physics is shown in the following figure:

DSM: the decomposed storage model is actually a way to design relational tables, that is, each row of records is decomposed into binary relational tables, and each binary table corresponds to an attribute plus an ID primary key, so that the two tables can also be Join. The correspondence between logic and physics is shown in the following figure:

Structural advantages of DSM

Avoid null values: after decomposition, there is no need for alignment between attributes, for sparse data, it can effectively avoid the storage of null values and save space.

Reduce data redundancy: can make the logic clear, that is, stylized. In NSM, if you do not compare the SS# fields of the two tables, you cannot tell whether the Nicole has the same name or a person. In a table, you can clearly see that Nicole is a person.

Differential File

First, I introduce a concept called Differential File (difference file, see "Differential Files: Their Application to the Maintenance of Large Databases"). Similar to the errata at the back of the book, similar to the concept of LSM, the main purpose is to reduce the load of data updates. When updating a record (a row of data), do not directly modify the original record, but write the entire new record in a Differential File, the format of this file is the same as the original table, each modified record here is one more record, when the file size exceeds a certain threshold, merge the two files.

A brief introduction to the advantages of Differential File:

(1) in the absence of Differential File, in order to prevent data loss caused by disk damage, you need to back up the database on a regular basis, while with Differential File, you only need to make a full backup at once, and then only incrementally back up the Differential File.

(2) when backing up regularly, the database state needs to be consistent, that is, the modification should be refused when backing up. This limitation can be avoided by backing up very small Differential File incrementally. The solution is to maintain a differential-differential file during backup, that is, the differential files in the current backup state (original file-differential file). But there is a premise to do this: Differential file is relatively small, big will be stupid.

(3) convenient testing, one unmodifiable data, two difference files, can run two systems at the same time, each system maintains a data and its own difference file. A production system, a test system, can be debug at any time.

(4) because the original file cannot be modified, simple concurrent access is supported.

In fact, whether Differential File stores a whole row of data or just stores modified attributes is just a matter of implementation, and complete data is used here.

Update query advantages of DSM

The difference file is mainly to record the update of the database, in the configuration of storing complete records, what is the difference between NSM and DSM? Obviously, DSM needs to record less information. As shown below:

Because each table in the DSM model has only two columns, it is also easy to build an index and query engine on it.

Shortcomings of DSM

As you can see, the ID in NSM is saved only once, but the ID in DSM needs to be saved many times. Will take up more disk space.

When updating, only one complete record needs to be updated for each modification or addition of a record in NSM, but the record needs to be modified once for each binary property sheet in DSM. If you build an index on a table, the index has more operations.

These shortcomings are basically tied to storage features.

At this point, I believe you have a deeper understanding of "what are the advantages and disadvantages of DSM". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report