Amoeba: open-source distributed database Porxy solution

Source: Internet
Author: User
Tags comparison lua mongodb mysql client database sharding

Based on this, server load balancer, read/write splitting, and high availability can be achieved. Compared with MySQL's official MySQL Proxy, the author emphasizes the convenience of amoeba configuration (XML-based configuration files, which are easier to write rules using SQLJEP syntax than MySQL Proxy based on lua scripts ).
Amoeba is equivalent to a router for SQL requests. It aims to provide mechanisms for server load balancer, read/write splitting, and high availability, rather than fully implementing them. You need to use MySQL Replication and other mechanisms to implement replica synchronization and other functions. Amoeba also uses a pluggable mechanism for underlying database connection management and routing implementation. Third parties can develop more advanced policies to replace the author's implementation. This program is generally in line with the KISS principle.

 

What is Amoeba?

 

The Amoeba project, the open-source framework, launched an Amoeba for Mysql software in 2008. This software is dedicated to the MySQL distributed Database front-end Proxy layer. It acts as the SQL routing function when accessing MySQL at the application layer and focuses on the development of the distributed Database Proxy layer. It is located between the Client and DB Server (s) and transparent to the Client. Provides load balancing, high availability, SQL filtering, read/write splitting, routing-related to the target database, and concurrent requests to merge results from multiple databases. With Amoeba, you can achieve high availability, load balancing, and data slicing of multiple data sources. Currently, Amoeba has been used in production lines of many enterprises. Main solution:

 


  • Reduce the complex multi-database structure caused by data splitting

  • Provides sharding rules and reduces the impact of data sharding rules on applications

  • Reduce the number of connections between db and client

  • Read/write splitting

 

Why use Amoeba ?

 

With the maturity of traditional database technology, the rapid development of computer network technology and the expansion of application scope, database applications have been widely established on computer networks. At this time, the centralized database system shows its shortcomings: centralized processing will inevitably lead to performance bottlenecks. The application Assembly runs on a computer. Once the computer fails, the entire system will be affected, low reliability; centralized processing results in inflexible system scale and configuration, and poor system scalability. In this situation, the centralized data base will develop towards distributed databases. Amoeba's transparent, simple configuration, and multiple advantages make it an excellent choice in distributed database proxy products.

 

Distributed Database proxy concepts

 

In the distributed database field, Amoeba is committed to solving data sharding and processing distributed data in a centralized manner on clients. Centralization is a relative concept. The client does not need to know the physical storage location of a certain data. This logic can be avoided on the business end, greatly simplifying the complexity of client operations on distributed data. Advantages of the distributed database system:

 


  • Cost reduction. Distributed databases can be geographically distributed. The structure of the system meets the requirements of such distribution. Users are allowed to employ, query, maintain, and perform local control to reduce communication costs and avoid centralized hardware devices requiring higher requirements. In addition, distributed databases have a small amount of data on a single machine, and their response speed is significantly improved.

  • Improve overall system availability. This avoids all the consequences of paralysis caused by the failure of a single database.

  • Easy scalability and system scale. The structure of the distributed database system can easily expand the system. A new node is added to the distributed data database without affecting the normal operation of the existing system. This method is more flexible and economical than expanding the centralized system. Expansion of large systems and system upgrades in centralized systems is often expensive and unfeasible due to hardware incompatibility and difficulty in software changes.

 

Amoeba Related products and their introduction

 

1. Amoeba for MySQL

 

Amoeba for MySQL is committed to the MySQL distributed database front-end proxy layer. It acts as the query routing function when accessing MySQL at the application layer, and focuses on distributed database proxy development. It is located between Client and DB Server (s. Transparent to the client. It has the following features: load balancing, high availability, Query filtering, read/write splitting, routing-related query to the target database, and concurrent requests to merge results from multiple databases. On Amoeba, you can achieve high availability, load balancing, and data slicing for multiple data sources. It is currently used in production lines of many enterprises. Amoeba for mysql is a virtual mysql client that provides the mysql protocol. The client connects to amoeba just like connecting to mysql. You must configure the relevant authentication attributes in amoeba.

 

 

2. Amoeba for Aladdin

 

Similar to Amoeba for MySQL, the MySQL protocol must be used to connect the client to Aladdin. The MySQL protocol is mainly used to support a wide range of mysql development languages. The Aladdin backend can connect to various databases at the same time. As long as these databases provide jdbc drivers. The emergence of aladdin can help enterprises actively in database integration. Users do not need to know what types of databases and physical addresses are used at the backend. aladdin analyzes SQL statements and obtains the tables and conditions to be queried, these rules are then combined with these conditions to route to the relevant physical database.

 

 

3. Amoeba for MongoDB

 

With the increasing rise of NoSQL, mongoDB, as a nosql database, has received wide attention for its outstanding performance. It can be said that mongoDB fills the gaps between traditional relational databases and traditional key-value databases, and has both outstanding characteristics. Amoeba for MongoDB provides a completely autonomous and controllable splitting method similar to Amoeba for MySQL, and tries to implement the same auto sharding function. Based on the Amoeba framework, similar to previous products, this product provides functions such as heartbeat detection, server load balancer, failover, and query aggregation, and retains the previous configuration methods, as long as you are familiar with the configuration of one of amoeba products, it is very easy to get started.

 

Compare Amoeba and its similar products

 

1. Amoeba for Mysql and MySQL Proxy comparison

 

In MySQL proxy 6.0, if you want to read/write splitting and read clusters and write cluster machines frequently, using mysql proxy requires a considerable amount of work. Currently, mysql proxy does not have a ready-made lua script. Mysql proxy does not have a configuration file at all, and the lua script is all about it. Of course, lua is quite convenient. Therefore, a large number of scripts are required to complete a complex configuration. Amoeba for Mysql only needs to be configured to meet the requirements.

 

2. Comparison between Amoeba for mongoDB and mongos

 

Data splitting in mongodb has a concept of chunk. Each chunk represents a data segment (range). When the size of a chunk reaches the specified data size, it is automatically split into two parts. Mongos is split based on the data segment (chunk), and the field based on the split must be a key. Currently, in most applications, IDS (especially user IDs) are sequential, and some users may be mobile phone numbers or membership card numbers. This makes the range splitting of the proxy difficult to implement. Therefore, although mongodb mongos provides the automatic sharding function, data splitting is not controllable and often cannot meet our needs. Amoeba for MongoDB provides a completely autonomous and controllable splitting method.

 

Amoeba What can't I do?

 


  • Currently, transactions are not supported.

  • Stored procedures are not supported currently (will be supported in the near future)

  • It is not suitable for data export from amoeba or query of large data volumes (for example, when a request returns more than million data records)

  • Currently, database/table Sharding is not supported. Currently, amoeba only supports Database Sharding instances. Each split node must maintain the same database table structure.

 

Amoeba Architecture

 

Amoeba is the development framework of DataBase Proxy. It is committed to solving data splitting and read/write splitting. The following describes the Amoeba framework

 


  • Built on Java NIO

    • NIO framework adopts the non-blocking mode. Unlike traditional Socket programming, it wastes system resources and has poor scalability in the case of a large number of concurrent requests.

  • Reusable Server Connection

    • Amoeba provides high availability for Database Connection. In the Amoeba system, all Database connections are shared to all clients connected to Amoeba at the same time.

  • Read/write splitting and data splitting

    • The traditional read/write splitting technology can only be solved through the client or related Database Driver technology, and the client configuration is also complex.

    • The performance of a single Database is always limited. Based on Amoeba, you can find a linearly scalable multi-data support. Amoeba provides DBA with a friendly data sharding rule similar to SQL syntax.
      At the same time, the client does not have to worry that too many DataBase servers will bring more configuration to the application.

  • Supports high availability and balance

    • Amoeba provides Database connection exception detection and connection recovery.

    • Users can save on using other expensive Server load balancer hardware devices. Amoeba provides multiple Database Server load balancer policies (round robin, number of active connections ).

  • Amoeba Sequence

 

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.