Database reading and writing separation technology

Source: Internet
Author: User
Tags mysql free

Read-write separation is to provide the performance of the program, with the increase of users, the pressure of the database will be more and more, the basic optimization of the database or SQL may not achieve the ultimate effect, read and write separation is simple to read and write the database to separate the database server, so as to effectively reduce the database pressure, can also reduce IO pressure. The primary database provides write operations, which provide read operations from the database.
After the system uses the cache, much of the functionality is done without a database. However, there is still a part of the functionality required and all write operations require access to the database. Therefore, to provide a master-slave database to separate read and write operations, the primary database is synchronized to the database, from the database is generally composed of multiple databases in order to achieve the purpose of reducing stress

As the business of a website expands, data increases, the pressure on the database becomes larger, and the basic optimization of the database or SQL may not be the ultimate result, we can use a read-write separation strategy to change the status quo. Read-write separations are now heavily used in many large Web sites, and this technology is not surprising. ebay is doing very well. ebay uses Oracle, and is heard to use Quest Share Plex for master-slave replication data.

Read-write separation is simply the database read and write operations to separate the corresponding database server, so as to effectively reduce the database pressure, but also to reduce the IO pressure. The main database provides write operations, from the database to provide read operations, in fact, in many systems, mainly read operations. When the primary database is written, the data is synchronized to the database from which the database integrity can be effectively guaranteed. Quest Shareplex is a comparison of cattle synchronization data tools, heard than the flow of Oracle itself is good, MySQL also has its own synchronous data technology. MySQL replicates data as long as it is binary log. Replication data is achieved through the logging of duplicate primary databases from the database. The good thing about this replication is that the data is synchronized to the database from the asynchronous method.

After the primary database is synchronized to the slave database, it is generally composed of multiple databases from the database in order to alleviate the stress. How does the read operation be assigned to the database? The read operation should be assigned to the server based on the pressure of the server, rather than a simple random allocation. MySQL provides mysql-proxy for read and write separation operations. But Mysql-proxy seems to be a long time not updated. Oracle can efficiently allocate pressure to read from the database through F5.


ebay's Read and write separation (found on the internet to use it)


MySQL read-write separation
The above-mentioned database synchronous replication, all in the same database, if I want to synchronize Oracle data to MySQL, in fact, the reason to implement this scenario is very simple, MySQL free, Oracle is too expensive. As if Quest Shareplex can not realize the change function. It seems that there is no such tool in the market now. So how does data synchronization happen? In fact, we can consider ourselves to develop a set of synchronous data components, through the message to achieve asynchronous replication data. In fact, this implementation to consider many aspects of the problem, high concurrency problems, failure records and so on. In fact, this method can also synchronize data to memcache . I heard that Oracle's stream can be implemented, but I haven't tried it.

Database reading and writing separation technology

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.