Database Table Design

Source: Internet
Author: User

Q: How to modify the table structure to existingProgramMinimum impact

1. Table design is to reserve a field without any business significance, such as userfiled1, userfield2,... to facilitate future ing with specific business fields.

 

2. Design a special field to store the XML file, and store the custom structure in the XML file to facilitate system expansion. Access is the XML string to be parsed

 

3. Map the physical table structure like hibernate to the logical structure of the object. Modification occurs in the structure of the physical table and hibernate mapping.

 

4. In the Java class, table names and field names are defined with immutable strings. For example

Public const string customers_table = "customers ";
Public const string email_field = "email ";
Public const string name_field = "name"; in this way, the modification only happens in a few places. Q: How to improve performance 1. For special business requirements, such as reconciliation and settlement of the payment platform, create a shadow table (such as paymentshadow) and redundant fields in other related tables. This method reduces associated queries and improves efficiency. 2. There is no foreign key or even primary key. This method is a bit like no SQL, but it has been encountered in commercial application systems.

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.