1 min Library1.1 According to the function of the librarySub-Library according to function. The common divide is 6 large libraries:
1 User Class Library: Used to hold information about a user. For example: Db_user,db_system,db_company and so on.
2 Business Class Library: Information that is used to hold the primary business. For example, the main business is a joke, use this library to save jokes business. For example: Db_joke,db_temp_joke and so on.
3 Memory class Library: primarily with MySQL's memory engine. Data from the foreground is found in the memory library and is faster. For example: Heap.
4 Picture Class Library: The index and association of the main saved picture. For example: Db_img_index,db_img_res.
5th Log Class Library: Record click, Refresh, log in logs and other information. For example: Db_log_click,db_log_fresh,db_log_login.
6 Statistical Class Library: Statistics on the business, such as clicks, refresh Amount and so on. such as Db_stat.
1.2 Installing the city Station Sub-LibraryIf the business across the country, in accordance with the function of the library, each city to copy an identical library, but the library suffix is the city name. such as Db_log_click_bj,db_log_click_tj,db_log_click_sh;
2 minute table2.1 According to the user or business number of the tablePairs with the user or business can be divided into N tables according to the number%n.
For example: Joke table.
Tb_joke_01,tb_joke_02,tb_joke_03,tb_joke_04 .....
2.2 table by dateFor tables such as logs or statistics classes. Can be according to the year, month, day, week table.
For example, click Volume Statistics.
tb_click_stat_201601,tb_click_stat_201602,tb_click_stat_201603
3 MySQL database common architectureCore: a master multi-slave, read and write separation.
MySQL database common library and sub-table method