Mysql database and Sub-table method (commonly used) _mysql

Source: Internet
Author: User

This article mainly introduces the MySQL database and the way of the table (commonly used), related to the MySQL database knowledge, the MySQL database of the relevant knowledge of the table of interest friends to study together

1 Sub-Library

1.1 According to functional sub-Library

Sub-Library by function. The common divide is divided into 6 major libraries:

1 User Class Library: Used to save information about the user. For example: Db_user,db_system,db_company and so on.

2 Business Class Library: Information that is used to hold the main business. For example, the main business is jokes, use this library to keep jokes business. For example: Db_joke,db_temp_joke and so on.

3 Memory Class Library: main memory engine with MySQL. The foreground data is looked up from the memory library in a fast speed. For example: Heap.

4 Picture Class Library: Mainly save the index of the picture and the association. For example: Db_img_index,db_img_res.

5th Log Class Library: Record click, Refresh, log information. For example: Db_log_click,db_log_fresh,db_log_login.

6 Statistics Class Library: The statistics of the business, such as the number of clicks, the amount of refresh and so on. such as Db_stat.

1.2 Installation City Station Sub-Library

If the business is all over the country, in accordance with the functional library, each city copies 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-meter

2.1 According to the user or business number of the table

For the user or business can be numbered%n, to be divided into N-table.
For example: Joke table.

Tb_joke_01,tb_joke_02,tb_joke_03,tb_joke_04 .....

2.2 According to the date of the table

For tables such as journals or statistical classes. Can be according to year, month, day, week table.

For example, click on the amount of statistics.

tb_click_stat_201601,tb_click_stat_201602,tb_click_stat_201603

3 MySQL Database common architecture

Core: A master more from, read and write separation.

About MySQL database and the way to divide the table (commonly used) to introduce you here, I hope to help you!

Related Article

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.