Used to analyze, monitor, and change communication data MySQL-Proxy (1) [figure] _ MySQL

Source: Internet
Author: User
For analysis, monitoring, and transformation of communication data MySQL-Proxy (1) [figure] TIP: MySQL-Proxy is a program between the MySQL database client and the server. it supports the embedded scripting language Lua. This proxy can be used to analyze, monitor, and transform communication data. it supports a wide range of application scenarios: load balancing and failover processing query analysis and log SQL macro (SQL macros) query rewriting execution shell


The MySQL-Proxy program is located between the MySQL database client and the server. it supports the embedded script language Lua. This proxy can be used to analyze, monitor, and transform communication data. it supports a wide range of application scenarios:
? Load balancing and failover

? Query analysis and logs

? SQL macro (SQL macros)

? Query rewriting)

? Execute shell commands

One of the most powerful functions of MySQL Proxy is to implement Read/Write Splitting )". The basic principle is to allow the primary database to process Transactional queries, but to process SELECT queries from the database. Database replication is used to synchronize changes caused by Transactional queries to the slave database in the cluster.

Jan Kneschke detailed this technique and connection pool problems in MySQL Proxy learns R/W Splitting:

To achieve read/write splitting, we need a connection pool. We can switch to the backend only when an authenticated connection has been enabled to a backend. The MySQL protocol first shakes hands. It is too late to authenticate the new connection when the query/return result is reached. We must ensure that we have enough open connections to maintain normal operation.

LUA script for read/write splitting:

-- Read/write splitting

--

-- Send all non-transactional Select statements to a slave database

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.