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.