MySQL Native Driver (
Mysqlnd
)
2545
and location,
mysqlnd
plugins do not have some of MySQL Proxy's disadvantages. For example,
with plugins, there is no single point of failure, no dedicated proxy server to deploy, and no new
programming language to learn (Lua).
A
mysqlnd
plugin can be thought of as an extension to
mysqlnd
. Plugins can intercept the majority of
mysqlnd
functions. The
mysqlnd
functions are called by the PHP MySQL extensions such as
ext/
mysql
,
ext/mysqli
, and
PDO_MYSQL
. As a result, it is possible for a
mysqlnd
plugin to intercept all
calls made to these extensions from the client application.
Internal
mysqlnd
function calls can also be intercepted, or replaced. There are no restrictions on
manipulating
mysqlnd
internal function tables. It is possible to set things up so that when certain
mysqlnd
functions are called by the extensions that use
mysqlnd
, the call is directed to the
appropriate function in the
mysqlnd
plugin. The ability to manipulate
mysqlnd
internal function tables
in this way allows maximum flexibility for plugins.
Mysqlnd
plugins are in fact PHP Extensions, written in C, that use the
mysqlnd
plugin API (which
is built into MySQL Native Driver,
mysqlnd
). Plugins can be made 100% transparent to PHP
applications. No application changes are needed because plugins operate on a different layer. The
mysqlnd
plugin can be thought of as operating in a layer below
mysqlnd
.
The following list represents some possible applications of
mysqlnd
plugins.
• Load Balancing
• Read/Write Splitting. An example of this is the PECL/mysqlnd_ms (Master Slave) extension. This
extension splits read/write queries for a replication setup.
• Failover
• Round-Robin, least loaded
• Monitoring
• Query Logging
• Query Analysis
• Query Auditing. An example of this is the PECL/mysqlnd_sip (SQL Injection Protection) extension.
This extension inspects queries and executes only those that are allowed according to a ruleset.
• Performance
• Caching. An example of this is the PECL/mysqlnd_qc (Query Cache) extension.
• Throttling
• Sharding. An example of this is the PECL/mysqlnd_mc (Multi Connect) extension. This extension
will attempt to split a SELECT statement into n-parts, using SELECT ... LIMIT part_1, SELECT
LIMIT part_n. It sends the queries to distinct MySQL servers and merges the result at the client.
MySQL Native Driver Plugins Available
There are a number of mysqlnd plugins already available. These include:
• PECL/mysqlnd_mc - Multi Connect plugin.
• PECL/mysqlnd_ms - Master Slave plugin.
• PECL/mysqlnd_qc - Query Cache plugin.
• PECL/mysqlnd_pscache - Prepared Statement Handle Cache plugin.
• PECL/mysqlnd_sip - SQL Injection Protection plugin.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...