Amoeba Mysql read and write separation

Amoeba (Amoeba) project, focusing on distributed database proxy development. Between and Client, DBServer (s). Transparent to the client. It has load balancing, high availability, SQL filtering, read-write separation, can route related queries to the target database, and can concurrently request multiple databases to merge results.
Main solutions:
• Reduce the complex multi-database structure caused by data segmentation
• Provide segmentation rules and reduce the impact of data segmentation rules on applications
• Reduce the number of connections between DB and clients
• Read and write separation
Second, why use Amoeba
At present, to realize the separation of master-slave read-write of mysql, there are mainly the following schemes:
1. Implemented through programs, there are many ready-made codes on the Internet, which are more complicated. If you add a slave server, you need to change the code of multiple servers.
2. It is realized through mysql-proxy. Since the separation of master-slave reading and writing of mysql-proxy is realized through lua scripts, the current development of lua scripts cannot keep up with the rhythm, and there is no perfect ready-made script, which leads to the use of lua scripts. In the production environment, the risk is relatively high. According to many people on the Internet, the performance of mysql-proxy is not high.
3. Self-developed interface implementation, this kind of scheme has high threshold and high development cost, which is not affordable for ordinary small companies.
4. It is implemented by Alibaba's open source project Amoeba, which has load balancing, high availability, SQL filtering, read-write separation, and can route related queries to the target database, and the installation and configuration are very simple.

 

Amoeba main configuration file ($AMOEBA_HOME/conf/amoeba.xml), used to configure the basic parameters of Amoeba service, such as Amoeba host address, port, authentication method, user name for connection, password, number of threads, timeout, other The location of the configuration file, etc.

The database server configuration file ($AMOEBA_HOME/conf/dbServers.xml) is used to store and configure the information of the database server represented by Amoeba, such as: host IP, port, user name, password, etc.

The segmentation rule configuration file ($AMOEBA_HOME/conf/rule.xml) is used to configure segmentation rules.

The database function configuration file ($AMOEBA_HOME/conf/functionMap.xml) is used to configure the processing method of the database function. Amoeba will use the method in the configuration file to parse the database function.

The segmentation rule function configuration file ($AMOEBA_HOME/conf/ruleFunctionMap.xml) is used to configure the processing method of the user-defined function used in the segmentation rule.

The access rule configuration file ($AMOEBA_HOME/conf/access_list.conf) is used to authorize or prohibit certain server IPs from accessing Amoeba.

The log specification configuration file ($AMOEBA_HOME/conf/log4j.xml) is used to configure the level and method of Amoeba output logs.

 

 

Guess you like

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