A text to let you master sub-library sub-table of the database optimization

The table below summarizes sub-sub-library

Separate read and write read and write database operating pressure dispersion, the dispersion sub-library sub-table storage pressure

Applicable scene

Similarly separate read and write, sub-library sub-table is to determine the optimal scheme was taken after no other optimization space. If the business has developed rapidly and that really would not soon to be a sub-library sub-table? Why is that good design different start?

According to architectural design of the "three principles" (simple principle, the right principle, the principle of evolution), a simple analysis:

First, there's the probability of "if" in fact happening is relatively low, there is a business to do 10 business can live very good, not to mention the rapid development, and about the same probability of winning the lottery. If we follow up on every business Taobao, scale micro-channel architecture designed to do, not only exhausted themselves, but also kill business.

Secondly, if the business really has developed rapidly, later in sub-library sub-table too late. Because the good business development, the appropriate investment of resources will increase, can put more people and more money, that brings code and business services sub-library complex problems can be solved by adding people, costs can be be resolved through increased funding.

Business sub-libraries

The table below summarizes the business division

Problems associated with: a vertical sub-table to increase the number of the operating table, a horizontal sub-table

Routing

Database operational problems

Implementation

Similarly separate read and write specific implementations are "program code encapsulated" and "encapsulating middleware", but the specific implementation complexity, because the table is determined as well as to specific SQL operations, the specific operation (e.g., count, order by, group by other ), processed differently depending on the operation.

At last

No. I welcome everyone's attention the public opening of the new [ calm as code ], the latest and most companies java face questions compiled over 1000 Road 400-page pdf document, the article will be updated on the inside, data compilation will be on the inside.

Article I remember like the point of a concern like yo, thanks for the support!

Guess you like

Origin juejin.im/post/5e453ea7e51d45270c27744b