Common Database Design (3) -- Record and change as many historical data problems common database design (2) -- change with a single record of historical data problems

Source: Internet
Author: User

Change to a single record of historical data: Common Database Design (2) -- change to a single record of historical data problems

1. Overview

There is a type of data stored in the historical customer operation data, such as the bidding documents, the refining scheme list, the price change of the product price, and the change list. Such historical data includes a mainstream water meter that controls the flow version and a list table corresponding to a specific version.

 

2. Requirements for multiple record changes and no future history records are stored in a single table

Business: when making a payment plan, you need to save the historical version data of the Plan and record the materials for which each plan pays.

Table Structure

Note: Like a single record, version control is included in the payment schedule. For details about how a subject implements version control, see change a ticket

3. Requirements for changing multiple records and storing future records are not required, and stored in multiple tables

Business: The business is the same as the business in business 2. However, when there are many payment lists and each payment plan has many versions, at this time, the amount of data in the payment plan list will be large. During normal access, we only need to know what the current available list is and do not pay attention to historical versions. When the amount of data in the List table reaches a certain level, the query efficiency will be seriously affected.

Structure:

The payment plan and payment plan list table are the same as above, and then a payment plan list change table is added.

4. Need to record changes and store future records

Business: When managing a supplier, there will be a demand for changing the product price, and multiple product prices will change together, and the price will change in the next month can be notified in advance. In this case, a streaming water meter is required to control the price change of multiple commodities, and this flow must support the function of storing historical data in the future.

Table Structure:

Note: add the effective date to the configuration table. Here, the change flow is the suppliergoodspricevar table, and the change list is the suppliergoodspricevardetails table. The available list is suppliergoods, indicating that the price Effective Date Field is added to the Change List where historical data is stored.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.