MySQL Fabric is awesome

壹頁書發表於2015-12-31

I’m fascinated about MySQL Fabric. After hours of study and test, I would say it is the best framework, hands down. Over the years, there are loads of MySQL HA products, like  and. There is a host of sharding solutions as well, such as Twitter’s  and Google’s . What makes MySQL Fabric really special is that it combines the idea HA and sharding, which mean it is more than a single solution. It is an fascinating and super user-friendly framework. However, bear in mind that MySQL Fabric only support MySQL version 5.6.10 and later due to the fact that it uses GTID to manage replication and other related operation. First, let’s see how Oracle defines MySQL fabric:

MySQL Fabric is a system for managing a farm of MySQL servers. Fabric provides an extensible and easy to use system for managing a MySQL deployment for sharding and high-availability.

It is written by python scripts which is very friendly to developers. Besides, MySQL Fabric is released under GPL license. That is to say, it is totally open source. On top of that, MySQL Fabric is developed and maintained by Oracle. If you are stuck with any trouble, you can turn to Oracle for help.

The following picture shows the architecture of MySQL Fabric:


As you can see, MySQL Fabric is consisted of several part:

Fabric Aware Connector: The connector contacts the Fabric server to find the location of a particular shard key. The connector also implements caching to avoid repeated round trips to the Fabric server to fetch the sharding information.

Fabric Server: default port is 33274. When starting up, it reads data from backing store.
    
Stores the sharding information
    
Maintains the sharding, like split and move

backing store: A MySQL database, storing meta data like servers, groups, HA, sharding, etc.

Global Group: If you want to use MySQL Fabric to sharding, you must create a global group. It stores all updates that must be propagated to all shards that are part of a sharding scheme. Besides, it also stores the global tables in this sharding definition.

Group: MySQL servers is maintained according to group. You can use MySQL Fabric to create group, add MySQL servers to group, establish replication, etc. In each group, only Primary node is read write, Secondary is always read only. If primary node crashed, user can use MySQL Fabric to failover automatically.



Developers must use Fabric-aware connectors to fully take advantage of its features to work with a set of servers managed by MySQL Fabric. Currently, it only support python and Java. MySQL fabric and Fabric-aware connectors are in MySQL utilities. You can download it from MySQL website(http://dev.mysql.com/downloads/utilities/).

MySQL Fabric is super user-friendly, which means you can create a MySQL cluster in less than 10 minutes. I’ve made two video about how to use MySQL Fabric to manage HA and shard. It is really easy. Be sure to check it out by yourselves.

轉載自:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29254281/viewspace-1969246/,如需轉載,請註明出處,否則將追究法律責任。

相關文章