【OneProxy for database middleware】

OneProxy was developed by Lou Fangxin, the former chief architect of Alipay, and currently provides technical support by Hangzhou Civilian Software Company (@ Civilian Architecture) founded by Lou Fangxin. Several companies are already using it in the build environment, including payments, e-commerce and other industries.

 

The main functions of OneProxy are:

1. Vertical sub-library

2. Level score table

3. Proxy cluster

4. Read high availability

5. Read-write separation (master does not participate in reading)

6. Read-write separation (master participates in reading)

7. Write high availability

8. Read and write random

 



 

OneProxy for MySQL is a database middleware based on the MySQL protocol, running between the application and the MySQL database, providing intelligent and transparent SQL routing and traffic analysis functions for the application. It can help you realize the cluster deployment of the back-end MySQL database without changing or only changing a small amount of application code. You can easily build a distributed database cluster like using a network switch/router to build a network, and analyze the traffic in real time. Provides rich performance monitoring functions for upper-layer applications and underlying database clusters.

OneProxy for MySQL allows different applications to reuse connections to the back-end database, reducing the number of concurrent connections to the database; it can instantly discover and remove unavailable back-end nodes, and forward application requests to other available nodes to achieve efficient fault isolation. Cooperate with Galera Cluster or MySQL Group Replication to achieve fast switching; the built-in daemon mode and HA VIP mechanism can easily achieve single-machine and multi-machine high availability of Proxy, ensuring the stability of business services; it can transparently distribute query statements to multiple MySQL standby database execution, using the read-write separation scheme to support tens of millions of concurrent accesses; it can also perform sub-database and sub-table routing according to the value in the SQL statement, and evenly distribute write operations to multiple MySQL main databases to build per second MySQL cluster with millions of TPS; merging result sets across multiple shards greatly simplifies the development workload of applications; in the case of sharding, SQL can be executed in parallel according to shards, which solves the problem of MySQL aggregation under large data volumes Statistical performance issues.

OneProxy for MySQL can perform security checks on access requests and reject dangerous DDL operations; it can perform access control based on IP addresses, allowing only trusted IP addresses to access; it can audit each SQL access request and implement SQL whitelisting Mechanism to completely eliminate SQL injection attacks; it can realize the separation of front-end and back-end passwords, and applications do not need to use real passwords to connect to the database to achieve database password protection; the SQL request frequency of front-end applications and back-end databases can be set separately to achieve QoS control; Sensitive data filtering and auditing can be achieved through regular expressions, and access and update operations of large amounts of data can also be recorded in logs to ensure data security.

OneProxy for MySQL can analyze traffic in real time and transparently, including SQL statements and result sets, count the running time of SQL and transactions in real time, analyze the SQL structure of transactions, and get real-time performance reports of various dimensions, and it can be conveniently and intuitively accessed through the built-in web server The real-time performance data can be viewed in real-time, making up for the insufficiency of the upper-layer application and MySQL real-time performance monitoring. Developed using C&C++, making full use of the high-performance asynchronous network event programming framework, a single OneProxy instance can support up to 40W QPS/TPS; and can fully utilize and manage memory, without the memory recovery problem of Java-like languages, ensuring 7x24 stability ;The built-in daemon mode and HA VIP mechanism can easily realize the multi-machine high availability of Proxy; The civilian software completely independently writes the source code, without external code and module dependencies, and can quickly analyze and solve the problems that may be encountered during the operation process. and faults.

 

 

Ultra high performance

OneProxy for MySQL is developed in C&C++ language, taking full advantage of the high-performance asynchronous network event programming framework (libevent), after 168 hours of high-pressure memory leak testing, achieving zero memory leaks, and using jemalloc to optimize memory allocation, a single OneProxy instance can Supports QPS/TPS up to 40W.

OneProxy for MySQL has a built-in efficient SQL analyzer. The average time for parsing a SQL is 100 microseconds. It basically achieves delay-free request forwarding, and there is no need to worry about the performance and delay consumption of the proxy layer; the mode of fixed and adjustable work process , can play excellent performance on any machine, make full use of CPU and 10 Gigabit network resources, and achieve 1 million QPS forwarding.

In the case of 256 concurrency, it has the same QPS capability as directly connected to MySQL, achieving lossless forwarding. Using the function of transparent connection pool, it has the effect of connection pool of MySQL Enterprise Edition, improves the processing capacity of the back-end database, and allows the application to expand infinitely without worrying about the number of back-end MySQL connections.

 

 

Transparent cluster

OneProxy for MySQL can implement transparent read-write separation routing for applications at the protocol layer, realize unlimited expansion of read operations, and monitor the replication delay between active and standby in real time, and integrate with MHA / PXC / MGR and other high-availability clusters With technical cooperation, it can realize high availability in which the application is not aware of the backend.

OneProxy for MySQL can transparently analyze SQL statements, implement sub-database sub-table routing at the protocol layer according to the value in the Where condition, realize flexible expansion of write operations, monitor the running status of the back-end database in real time, and perform failover according to the established cluster strategy , the application does not need to know the backend running status and node scale.

OneProxy for MySQL supports multi-result set operations across shards, such as sorting, summarizing, paging, etc., so that applications do not need to know the scale and number of back-end nodes, realize application-transparent expansion and contraction, and build application-transparent databases cluster.

 

 

security audit

OneProxy for MySQL can intercept insecure login and access requests in real time, and can perform flexible processing according to the type of SQL request, such as prohibiting DDL statements, not allowing data deletion commands, etc. Identity for additional authentication (based on an irreversible algorithm).

OneProxy for MySQL completely takes over the login verification work of the application, which can realize the separation of passwords between the front and back ends. The application only configures the password for logging in to the OneProxy, and the password for actually logging in to the database only needs to be configured on the OneProxy to prevent hackers from obtaining the password from the application machine.

OneProxy for MySQL can check and intercept every SQL request in real time, and can dynamically configure black and white SQL lists to check SQL features to prevent SQL injection attacks. With rich real-time access statistics, and logging of all SQL error operations, exploratory hacking can be quickly discovered.

 

 

Traffic Analysis

OneProxy for MySQL can analyze the traffic of SQL and result sets in real time. Compared with the performance view of the database backend, OneProxy knows the source IP address, session and transaction context of the SQL statement. It has more dimensions to display data and has stronger results. presentation ability.

Based on the statistics of the IP dimension, you can quickly understand the database interaction of different applications, including application access to specific tables, SQL execution information, and transaction performance data, as well as the intersection of databases used by different applications, so as to quickly optimize the data architecture.

According to the statistics of the transaction dimension, you can quickly understand the interaction between different transactions and databases, including transaction execution frequency, overall execution time, pure SQL execution time, and time occupied by DML operations, efficiently optimize performance, and easily analyze transactions. The correlation between them promotes the optimization of the business data model.



 

 

Stable and reliable

OneProxy for MySQL has undergone 168 hours (tens of billions of SQL) high-voltage tests, and has opened Binary to public users for trial use. Hundreds of users have used the same OneProxy version to verify rich business scenarios, creating a stable and reliable quality of OneProxy.

OneProxy for MySQL has a built-in high-availability mechanism, that is, a process-level restart mechanism, and a cross-machine HA/VIP mechanism (three nodes can be implemented, and the Paxos-like mechanism can be used to achieve multi-point selection), and it can also be used with Haproxy / LVS/Zookeeper cooperate to implement a multi-active architecture to ensure the high availability of OneProxy.

OneProxy for MySQL can work with a variety of high-availability architectures (such as MHA, Percoan XTraDB Cluster, MySQL Group Replication, etc.) to quickly discover, isolate or switch faults, and ensure the stability and reliability of the business layer.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326397159&siteId=291194637