Giter Club home page Giter Club logo

mysqlnd_ms's Introduction

Introduction
============

The mysqlnd replication and load balancing plugin (mysqlnd_ms) adds easy to use
MySQL replication support to all PHP MySQL extensions that use mysqlnd.
 
As of version PHP 5.3.3 the MySQL native driver for PHP (mysqlnd) features an 
internal plugin C API. C plugins, such as the replication and load balancing 
plugin, can extend the functionality of mysqlnd.
 
The MySQL native driver for PHP is a C library which ships together with PHP as
of PHP 5.3.0. It serves as a drop-in replacement for the MySQL Client Library 
(AKA libmysql/libmysqlclient). Using mysqlnd has several advantages: no extra 
downloads because it comes with PHP, PHP license, lower memory consumption in 
certain cases, new functionality such as asynchronous queries.
 
Mysqlnd plugins such as the replication and load balancing plugin operate
mostly transparent from an user perspective. The replication and load balancing
plugin supports all PHP applications and all PHP MySQL extensions ( mysqli,
mysql, PDO_MYSQL). It does not change existing APIs. Therefore, it can easily
be used with existing PHP applications.
 

Key Features
============
	 
 * Transparent and therefore easy to use
   o supports all PHP MySQL extensions
   o no API changes
   o very little, if any, application changes required, dependent on the usage 
     scenario required
 * Featured read-write split strategies
   o Automatic detection of SELECT, supports SQL hints to overrule automatism
   o user-defined
 * Featured load balancing strategies
   o Round Robin: choose different slave in round robin fashion for every
     slave request.
   o Random: choose random slave for every slave request.
   o Random once (sticky): choose random slave once to run all slave requests
     for the duration of a web request.
   o User-defined. The application can register callbacks with mysqlnd_ms.
																													     
Limitations
===========																													     

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, including, for example, SHOW statements, are
considered as write requests to be sent to the MySQL master server. The 
build-in behaviour can be overruled using SQL hints or an 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.

The plugin does not support native prepared statements. Please note that
PDO_MySQL is using a client-side prepared statement emulation by default.
Client-side emulated prepared statements are fully supported by the replication
and load balancing plugin because the emulation is not using native prepared
statements. If you are using PHP based database abstraction, please consult the
vendor manual to learn if a client-side prepared statement emulation is used.
																													     
On the name
===========

The shortcut mysqlnd_ms stands for mysqlnd master slave plugin. The name was
choosen for a quick-and-dirty proof-of-concept. In the beginning the developers 
did not expect to continue using the code base.

Installation
============

If your system has the PEAR and PECL tools installed this plugin can be installed
by a single command from the command line.

If you want to use the stable version:

    # pecl install mysqlnd_ms

If you want to use an alpha version:

    # pecl install mysqlnd_ms-alpha

Further information
===================

Please refer to the full documentation on http://php.net/mysqlnd_ms

mysqlnd_ms's People

Contributors

vinothzomato avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.