Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2558
• PHP 5.4.0 or newer: transaction aware when using API calls only to control transactions.
• Weighted load balancing: servers can be assigned different priorities, for example, to direct more
requests to a powerful machine than to another less powerful machine. Or, to prefer nearby
machines to reduce latency.
• Global transaction ID
• Client-side emulation. Makes manual master server failover and slave promotion easier with
asynchronous clusters, such as MySQL Replication.
• Support for built-in global transaction identifier feature of MySQL 5.6.5 or newer.
• Supports using transaction ids to identify up-to-date asynchronous slaves for reading when
session consistency is required.
• Throttling: optionally, the plugin can wait for a slave to become "synchronous" before continuing.
• Service and consistency levels
• Applications can request eventual, session and strong consistency service levels for connections.
Appropriate cluster nodes will be searched automatically.
• Eventual consistent MySQL Replication slave accesses can be replaced with fast local cache
accesses transparently to reduce server load.
• Partitioning and sharding
• Servers of a replication cluster can be organized into groups. SQL hints can be used to manually
direct queries to a specific group. Grouping can be used to partition (shard) the data, or to cure the
issue of hotspots with updates.
• MySQL Replication filters are supported through the table filter.
20.7.6.2. Limitations
Copyright 1997-2012 the PHP Documentation Group. [2230]
The built-in read-write-split mechanism is very basic. Every query which starts with
SELECT
is
considered a read request to be sent to a MySQL slave server. All other queries (such as
SHOW
statements) are considered as write requests that are sent to the MySQL master server. The build-in
behavior can be overruled using
SQL hints
, or a user-defined
callback function
.
The read-write splitter is not aware of multi-statements. Multi-statements are considered as one
statement. The decision of where to run the statement will be based on the beginning of the statement
string. For example, if using
mysqli_multi_query
to execute the multi-statement
SELECT id FROM
test ; INSERT INTO test(id) VALUES (1)
, the statement will be redirected to a slave server
because it begins with
SELECT
. The
INSERT
statement, which is also part of the multi-statement, will
not be redirected to a master server.
Note
Applications must be aware of the consequences of connection switches that
are performed for load balancing purposes. Please check the documentation on
connection pooling and switching
,
transaction handling
,
failover
load balancing
and
read-write splitting
.
20.7.6.3. On the name
Copyright 1997-2012 the PHP Documentation Group. [2230]
Summary of Contents for 5.0
Page 1: ...MySQL 5 0 Reference Manual ...
Page 18: ...xviii ...
Page 60: ...40 ...
Page 396: ...376 ...
Page 578: ...558 ...
Page 636: ...616 ...
Page 844: ...824 ...
Page 1234: ...1214 ...
Page 1427: ...MySQL Proxy Scripting 1407 ...
Page 1734: ...1714 ...
Page 1752: ...1732 ...
Page 1783: ...Configuring Connector ODBC 1763 ...
Page 1793: ...Connector ODBC Examples 1773 ...
Page 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Page 2850: ...2830 ...
Page 2854: ...2834 ...
Page 2928: ...2908 ...
Page 3000: ...2980 ...
Page 3122: ...3102 ...
Page 3126: ...3106 ...
Page 3174: ...3154 ...
Page 3232: ...3212 ...