Database read/write splitting

Source: Internet
Author: User

As the business of a website continues to expand and data increases, the pressure on the database increases, and the basic optimization of the database or SQL cannot achieve the final effect, we can use the read/write splitting policy to change the status quo. Read/write splitting is now widely used in many large websites. This technology is not surprising. Ebay is doing very well. Ebay uses oracle, and I heard that it uses Quest Share Plex for master-slave data replication.

In simple terms, read/write splitting separates read and write operations from different database servers. This effectively reduces the pressure on the database and reduces the I/O workload. The primary database provides write operations and read operations from the database. In fact, in many systems, it is mainly read Operations (# add in general Internet applications, after some data investigation, it is concluded that the proportion of read/write is roughly
About, that is to say, a large number of data operations are concentrated reading operations, which is why we have multiple Slave ). When the primary database performs write operations, data must be synchronized to the slave database to effectively ensure database integrity.Quest SharePlexIt is a relatively good data synchronization tool. I heard that it is better than the stream replication of oracle itself, and mysql also has its own data synchronization technology. Mysql only needs to use binary logs to copy data. Data replication is achieved through repeated operations on the master database in the slave database. The best way to replicate data is to synchronize data to the slave database through an Asynchronous Method.

After the master database is synchronized to the slave database, the slave database is generally composed of multiple databases to reduce the pressure. How to allocate read operations to the slave database? Read operations should be allocated to the server according to the server pressure, rather than simply random allocation. Mysql provides MySQL-Proxy for read/write splitting. However, MySQL-Proxy does not seem to be updated for a long time. Oracle can use F5 to effectively allocate read pressure from the database.

Ebay read/write splitting (used when it is found online)


Mysql read/write splitting
The databases mentioned above are synchronized and replicated from the same database. If I want to synchronize oracle Data to mysql, the reason for implementing this solution is very simple. mysql is free of charge, oracle is too expensive. It seemsQuest SharePlexIt cannot be changed. It seems that this tool is not available in the market. How should we implement data synchronization? In fact, we can develop a set of data synchronization components to achieve Asynchronous Data Replication through messages. In fact, many problems, such as high concurrency and failure records, need to be considered in this implementation. In fact, this method can also synchronize dataMemcache. I heard that oracle Stream can also be implemented, but I have not tried it.

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.