MySQL Fabric as a MySQL High-Availability Solutions
MySQL Fabric is a framework for managing groups of MySQL Servers and using those servers to provide services.
In the current version the services provided are High Availability (built on top of MySQL Replication) and scale-out (by sharding the data).
What MySQL Fabric adds in Terms of HA ?
Failure detection & promotion (which is manual process in normal MySQL Replication)
Routing database requests
It can be scale-out through its sharding feature and available types are.
Hash
Range
MySQL Fabric is available for use under the GPL v2 Open Source license or it can be commercially licensed as part of MySQL Enterprise Edition or MySQL Cluster Carrier Grade Edition.
MySQL Fabric FAQs are at : https://www.mysql.com/products/enterprise/fabric/faq.html#2
How it works !
MySQL Fabric is implemented as a MySQL Fabric node/process (which performs management functions) and Fabric-aware connectors that are able to route queries and transactions directly to the most appropriate MySQL Server.
The MySQL Fabric node stores state and routing information in its State Store (which is a MySQL database).
The MySQL Servers that are being managed by MySQL Fabric continue to use InnoDB (and in the future NDB/MySQL Cluster may also be supported)
MySQL Fabric manages one or more HA-Groups where each HA-Group contains one or more MySQL Servers. For High Availability, a HA Group contains a Primary and one or more Secondary MySQL Servers.
The Primary is currently a MySQL Replication master that replicates to each of the secondaries (MySQL Replication slaves) within the group.
MySQL Fabric requirements
License :
MySQL Fabric is available for use under the GPL v2 Open Source license or it can be commercially licensed as part of MySQL Enterprise Edition or MySQL Cluster Carrier Grade Edition.
Requirements and pre-requisites :
MySQL 5.6+
Connectors (Python/Java/PHP for now)
MySQL Fabric setup : For deployment, the minimal HA configuration would need 3 or more machines:
2 to host MySQL Servers
1 to host the MySQL Fabric process (that machine could also be running application code)
MySQL Fabric FAQs : https://www.mysql.com/products/enterprise/fabric/faq.html#2
Is there any possibility of split brain (among slaves) when promoting a slave to be the new master?:
For the current solution, based on MySQL Replication, there will at any point be at most a single write server.
It can still be the case that one of the slaves are lagging (but if you enable semi-synchronous replication then the slave will be able to catch up as it has everything at least in its relay log), but no split brain situation.
What happens if the slave is lagging and the primary goes down?:
If using semi synchronous replication then the slave will apply it’s queued replication events before becoming master;
if using asynchronous replication then those changes will not be there once the slave is promoted to master.
For promoting slave, how does Fabric determine which slave to promote? How is it guaranteed to have all available binlog events applied?:
Currently, MySQL Fabric picks the slave that has the most changes from the master and re-direct the other slaves to the promoted slave. The outstanding events in the relay log is processed as normal.
Note that as a user, you can specify which slaves are candidates to be promoted to master and also which use semisynchronous rather than synchronous replication.
Is the Fabric Connector node a single point of failure or does it have failover as well?:
Each application instance has an associated connector instance; if they fail then the other instances continue to provide service.
Of course, if you have a single application process then you have a vulnerability – regardless of what the database provides.
MySQL Licenses
MySQL Enterprise License cost:
MySQL 5.5+ ( 5000 USD/anum per server, 4 sockets ) which includes following advanced components.
24*7 Support, KB, Maintenance releases
MEM (MySQL Enterprise Monitoring )
MEB ( Enterprise Backup tools- hot backups)
MySQL Fabric & other Utilities
Encryption
Firewall
Authentication .. Etc
MySQL Cluster Carrier Grade Edition :
USD 10,000 for MySQL Cluster along with above MySQL Enterprise Licenses
Pricing is “per Server”, for 2 classes: Servers with 1-4 Sockets, and Servers with 5+ Sockets
More details at https://www.mysql.com/products/
Below are some of the main extra capabilities that MySQL Cluster has over MySQL Fabric are:
Synchronous replication
Faster (automated) fail-over (resulting in higher availability)
Transparent sharding
Cross-shard joins and Foreign Keys
In-memory, real-time performance
MySQL Fabric on the other hand, allows the application to stick with the InnoDB storage engine which is better suited to many applications.