1.
Introduction toMySQL Clustering (ndb-cluster stogare)
:
MySQL provides a high-reliability solution in the form of a storage engine. It is transaction-safe and replicates data in real time. It can be used in situations that require high reliability and load balancing. This solution requires at least three node servers to achieve good results.
Cost:
The node server has significant RAM requirements, linearly proportional to the database size;
it is best to use a Gigabit Ethernet network;
it also requires the use of expensive SCI cards from Dolphin.
Advantages:
Can be used in load balancing situations;
can be used in high reliability situations;
high scalability;
true database redundancy;
easy to maintain.
Disadvantages:
As the database gets larger, RAM requirements become greater, so the cost is high;
Speed:
Almost slower than a typical standalone server (no Gigabit Ethernet, no SCI cards, fewer storage engine related restrictions) 10 times.
Application scenarios:
redundancy, high reliability, load balancing
2. MySQL / GFS-GNBD/ HA (Active/Passive)
Introduction:
If multiple MySQL servers use shared hard disks as data storage, what about this solution?
GFS/GNBD can provide the required shared hard drive.
GFS is a transaction-safe file system. At the same time you can have a MySQL use shared data.
Cost:
The cost of up to n high-performance servers, one of which is activated and the others serve as backup servers.
Pros:
High reliability
Some degree of redundancy
Scales to high reliability
Cons:
No load balancing
No guaranteed redundancy
Cannot scale write operations
2x
the speed
of a standalone server.Better support for read operations.
Application scenarios
require high reliability and read-intensive applications
3. Introduction to MySQL / DRBD / HA (Active/Passive)
:
If multiple MySQL servers use shared hard disks as data storage, what about this solution?
DRBD can provide such a shared hard drive. DRBD can be configured to be transaction safe.
At the same time you can have a MySQL use shared data.
Cost:
The cost of up to n high-performance servers, one of which is active and the others serve as backup servers.
Advantages:
high reliability;
a certain degree of redundancy;
scalable in the name of high reliability.
Disadvantages:
No load balancing,
no guaranteed redundancy,
no scalability in terms of write load,
speed:
equivalent to a single server in terms of reading and writing,
applications
requiring high reliability and read operation intensive applications
4. MySQL Write Master / Multiple MySQL Read Slaves (Active/Active)
Introduction:
Consider different situations of reading and writing DB database connections. You can use one master server for write operations and n slave servers for read operations.
Cost:
Up to 1 high-performance write server, cost
advantages of n read servers:
high reliability of read operations;
load balancing of read operations;
scalable in terms of load balancing of read operations.
Disadvantages:
high reliability without write operations;
load balancing without write operations;
no scalability in write operations;
speed:
same as stand-alone server; better support in read operations
Application scenarios are
read-intensive and require high reliability and load balancing applications.
5. Standalone MySQL Servers (Functionally separated) (Active)
Multiple independent servers with separated functions. They do not have high reliability and load balancing capabilities. They have too many obvious shortcomings and will not be considered.
Summary:
The HA solution recommended by the MySQL official website is a combination of DRBD (scheme 3 in this article) and Replication (scheme 4 in this article). If Linux Heartbeat can also implement the Auto-failover function, in this case, we will find that the downtime will be greatly reduced.