MySQL Cluster architecture Picture
1,MySQLEnterprise Common Cluster Architecture
in the enterprise of small and medium-sized internet. MySQLcluster is generally the architecture. WEBread when the node reads the databaseDbproxyserver. Dbproxyserver through theSQLstatement to read and write the database to separate. Read the request payload to the Slave library (you can also add the main library), write the request to write the main library.
Here's Dbproxy is the only export of the DB cluster so it needs to be made highly available.
Drproxyis a common software for database read and write separation,Amoeba,Mycat,Cobaris also very common. This type of software not only has a read-write separation function, but also provides load balancing and back-end node health checks.
In addition to this kind of database middleware software implementation, the database can also be written in the program.
Usually our main library is going to do two-master high-availability, implementing the main library to hang off another main library and take over immediately. If you do not double-master, you need to do a state migration when you take over the main library from the library, there is a delay.
The high availability focus of the database main library is about data synchronization. The more commonly used high-availability scenarios are:
1.keepalived+mysql Replication. ThroughkeepalivedImplementVIPelegant, throughMySQLself-bringing synchronization schemeReplicationachieve data synchronization.
2.HEARBEAT+DRBD. ThroughDRBDto realize the synchronization of the dual master data, this data synchronization is based on the block device. Much faster than the usual synchronization scheme. ThroughHeartbeatImplementVIPDrift andDRBDswitch management of resources.
3, keepalived+mha
5 > A. We can put three of them as user access nodes, the other as the internal staff of the query node. Because the internal staff query node is generally in accordance with the time period of the query, not through the index, occupy more resources, so to the node alone, so as not to affect customer access. Finally, we should leave a backup of the database from the library.
Data consistency from the library can be maintained by master-Slave directly to the main library, or slave-to-master replication from other libraries (the advantage is to reduce the main library pressure, the drawback is a slightly larger delay).
2,MYSQLData Architecture
Database Server=="Database (multiple Instances)=="Multiple Libraries=="Multiple Tables=="multiple field rows and columns (data)
You can run multiple instances on a single database server, one instance with multiple libraries, one library with multiple tables, and one table with multiple columns.
From for notes (Wiz)
MySQL Enterprise common cluster diagram