On the treatment of high concurrency ideas simple scene

1. Stand-alone cluster change

2. The sub-library sub-table database, separate read and write

Common sub-library sub-table:

(1) Vertical table:

  Popular to say that the "big table split small table." Split is based on a relational database and "column" (field) performed. Typically, a field in the table more, you can establish a new "extension table", will not often used or the length of the field split out into a larger "extended table".

(2) Vertical library:

  In the "micro-services" prevalent today has been very popular. The basic idea is to divide the service module according to a different database, rather than earlier as all the data tables are placed in the same database.

(3) the horizontal part table:

  Transverse horizontal partition table is also called sub-table, easier to understand, that the different data rows in the table can be regularly distributed to different database tables (tables stored in the same database), so to reduce the amount of a single table of data to optimize query performance. The most common way is to be taken after the mold Hash and resolved by the primary key or field time.

(4) the level of sub-library sub-table:

The same level of sub-library sub-table and the level of sub-table mentioned above idea, the only difference is that these spin-off of tables stored in different data. This is also a lot of large Internet companies chosen approach.

 

3. Add cache

4. Add the message middleware, a synchronization request asynchronously

 

The basic idea of ​​using more than a few can achieve the purpose of reducing database concurrent requests, system crashes are also often start from the database, paying particular attention to here is sometimes hard disk is full will result in the database of the number of connections filled,

So be sure to do a good hard real-time monitoring state, the general operators have this service.

Guess you like

Origin www.cnblogs.com/pzyin/p/11414386.html