MySQL database common library and sub-table method

Source: Internet
Author: User

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

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.