Database recommendation naming rules

Source: Internet
Author: User

From MySQL performance tuning and Architecture Design:
1. The database and table names should be as consistent as possible with the service module names;
In this way, when DBA maintains related database objects, new developersProgramRelated Technologies (or non-technical
Skills) personnel can easily understand the relationship between business logic and data.
2. A type of table serving the same submodule should be prefixed or suffixed with the submodule name (or some words;
Adding a prefix or suffix to a table of the same type of function also enables users who can view and use the table to quickly
The name is associated with the corresponding functions and related services. Both from the maintenance point of view and from the Use point of view will bring non-
Great convenience.
3. The table name should contain words corresponding to the stored data as much as possible;
This is especially important for new employees. to get familiar with the data as soon as possible, learn about the relevant business as soon as possible, and quickly locate the database
The data corresponding to each table is very helpful.
4. Keep the field name consistent with the actual data.
I think readers and friends should be very clear about the significance of this point. Each table will have many fields corresponding to various data types.
For different attributes, we need to clarify the meaning of their respective representatives. Apart from the complete and standardized description documents, the field names with clear and reasonable names are also
A useful supplement, and more direct.
5. The index name should contain all index key fields or abbreviations as much as possible, and the order of each field name in the index name should be
The index order in the index is consistent, and try to include a prefix or suffix similar to idx or ind, with the table name
Its object type is an index, and it can also contain the name of the table to which the index belongs;
The biggest advantage of this is that DBAs can directly and clearly understand the index size through the index name during the maintenance process.
Partial information.
6. Constraints and other objects should also contain the names of the tables or other objects as much as possible, with their respective relationships as table names.

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.