Five database design errors to be vigilant _ MySQL

Source: Internet
Author: User
Everyone makes mistakes, but as a database administrator, we should avoid mistakes as much as possible to reduce costs for the company and ensure data quality. The following five Database design mistakes must be vigilant. 1. select an appropriate data type to avoid excessive database expansion. everyone should make mistakes, but as a database administrator, we should avoid mistakes as much as possible to reduce costs for the company and ensure data quality. The following five Database design mistakes must be vigilant.

1. select an appropriate data type to avoid excessive database expansion

Pay attention to the selection of data types. For example, if you know that the value range of a column is between 0 and 100,000, you do not need to use the BIGINT data type, because the INT type is sufficient.

Selecting the former means that every time you insert a piece of data, it is a waste of 4 bytes than the latter. This may sound insignificant, but the problem will be highlighted as the data volume increases.

2. compliance with ISO standards to ensure interoperability between heterogeneous database systems

The IT infrastructure of large enterprises is very complex and may require data exchange between different database systems. Take the TIMESTAMP data type as an example. the TIMESTAMP data type defined in Transact-SQL is different from the ISO standard. Other database systems are also different from ISO standards. Therefore, we should follow the ISO standards as much as possible to ensure interoperability between heterogeneous database systems.

3. serialization with appropriate mechanisms

It is necessary to ensure the serialization of records inserted into the database. many database designers use various mechanisms to ensure the serialization of applications. Some database designers like to introduce GUID in database design, but introducing GUID is not a good choice, because GUID is not serialized by default, using the GUID column as the primary key and/or index may even cause performance problems.

4. take the foreign key into account when creating an index

If a foreign key has been defined in your database, you need to pay more attention when creating an index. you need to incorporate this situation into the database design.

5. do not ignore candidate keys related to business requirements

The database designer should not focus only on the proxy key, but forget the business needs. Obviously, this is very bad for data quality. Duplicate values may occur if you have not created any constraints or indexes on the business-related candidate keys.

Keep away from the above five Database design mistakes. This will help you save costs for your company and improve data quality.

Original article: Do You Make These 5 Database Design Mistakes?

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.