Large Web site Architecture Evolution (5) database read/write separation

Source: Internet
Author: User

After using the cache, so that most of the data read operation access can be done without the database, but still have a portion of the read operations (including misses cache, and cache expired) and all write operations need to access the database, when the site's traffic continues to increase, The database will become a performance bottleneck for the site because of high load pressure.

At present, most of the mainstream database provides a master-slave function, by configuring the master-slave relationship between the two databases, you can synchronize the data of one database server to another server, the Web site uses this function of the database, can realize the database read and write separation, thereby improving the load pressure of the database.

When the application server writes the data, accesses the main database, the primary database synchronizes the data update to the slave database through the master-slave replication mechanism, so that when the application server reads the data, it can obtain the data from the database, in order to facilitate the application access to read and write the detached database. Usually in the application server side with a dedicated data access module (also called the data Access layer), so that the database read and write separation to the application transparent.

Database read/write separation

Schemas such as:

Summary: Database read and write separation alleviates the pressure on the database, but at the same time brings two problems:

1, the problem of data synchronization. Generally use the database to bring the data replication mechanism to solve, you can refer to: http://note.youdao.com/noteshare?id=1245e28ab69dc951bb9df9f53e9abc16&sub= e1f1b4aaeb9140d6b37b1998163dbd0b

2, the application is selected for the data source problem. For an application, all subsequent writes are taken from the main library, while the read operation goes from the library. These operations are typically done through the middleware data access layer.

Large Web site Architecture Evolution (5) database read/write separation

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.