Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2577
"fetch_last_gtid" : "SELECT @@GLOBAL.GTID_DONE AS trx_id FROM DUAL",
"check_for_gtid" : "SELECT GTID_SUBSET('#GTID', @@GLOBAL.GTID_DONE) AS trx_id FROM DUAL",
"report_error":true
}
}
}
20.7.6.4.8. Cache integration
Copyright 1997-2012 the PHP Documentation Group. [2230]
Version requirement, dependencies and status
Please, find more about version requirements, extension load order
dependencies and the current status in the
concepts section
!
Databases clusters can deliver different levels of consistency. As of PECL/mysqlnd_ms 1.2.0 it is
possible to advice the plugin to consider only cluster nodes that can deliver the consistency level
requested. For example, if using asynchronous MySQL Replication with its cluster-wide eventual
consistency, it is possible to request session consistency (read your writes) at any time using
mysqlnd_ms_set_quos
. Please, see also the
service level and consistency
introduction.
Example 20.246. Recap: quality of service to request read your writes
/* Request session consistency: read your writes */
if (!mysqlnd_ms_set_qos($mysqli, MYSQLND_MS_QOS_CONSISTENCY_SESSION))
die(sprintf("[%d] %s\n", $mysqli->errno, $mysqli->error));
Assuming PECL/mysqlnd has been explicitly told to deliver no consistency level higher than eventual
consistency, it is possible to replace a database node read access with a client-side cache using time-
to-live (TTL) as its invalidation strategy. Both the database node and the cache may or may not serve
current data as this is what eventual consistency defines.
Replacing a database node read access with a local cache access can improve overall performance
and lower the database load. If the cache entry is every reused by other clients than the one creating
the cache entry, a database access is saved and thus database load is lowered. Furthermore, system
performance can become better if computation and delivery of a database query is slower than a local
cache access.
Example 20.247. Plugin config: no special entries for caching
{
"myapp": {
"master": {
"master_0": {
"host": "localhost",
"socket": "\/tmp\/mysql.sock"
}
},
"slave": {
"slave_0": {
"host": "127.0.0.1",
"port": "3306"
}
},
}
}
Example 20.248. Caching a slave request
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 ...