Archiv der Kategorie 'PlanetPHP (english)'
Tuesday, January 31st, 2012
Why read stale data from an asynchronous MySQL replica (slave)? Fetch it from a local cache instead! Good for the clusters overall load, good for your applications performance. And, possible with PECL/mysqlnd_ms 1.3, the replication and load balancing plugin for PHP MySQL users.
The idea is simple
Any application using asynchronous MySQL replication must be capable of […]
Posted in PlanetMySQL (english), PlanetPHP (english) | 1 Comment »
Tuesday, January 24th, 2012
Is it worth the efforts to cache the results of a MySQL query at the client? In most cases the answer is: try it, measure it! Install the development version of the mysqlnd query cache plugin, which can be used with PDO_MySQL, mysqli and mysql. Set three PHP directives and find the answer […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Friday, January 13th, 2012
New in the PHP manual: a quickstart for the mysqlnd query cache plugin. PECL/mysqlnd_qc, the mysqlnd query cache plugin, is transparent and ease to use. But, how? Some pointers have been given in assorted presentations, here on my blog and in some, few examples from the manual. Fixed. You can now browse a quickstart […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Thursday, January 12th, 2012
New in the PHP manual: a mysqli quickstart. You are new to PHP but you know how to code, you know SQL, you know relational databases and MySQL? Then, I hope, this is for you. All you need is a quick overview on the concepts? The rest is in the reference section! Here […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Wednesday, January 11th, 2012
We are giving PECL/mysqlnd_qc a second chance. PECL/mysqlnd_qc is a query cache plugin for mysqlnd. It can cache any query issued by any PHP MySQL extension using storage handler for process memory, APC, Memcache and SQLlite. Its default invalidation strategy is Time to Live (TTL). Using a more sophisticated invalidation strategy is possible. Of course, […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Friday, December 23rd, 2011
The MySQL part of the PHP reference manual is currently being restructured: new landing and overview page, mysqli quickstart prepared. Ten years ago, there was the mysql extension and that was it. Today, beginners are faced with three MySQL APIs/extensions, two libraries and more than three library plugins. MySQL support by PHP has never been […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Friday, December 23rd, 2011
A single MySQL server is a single point of failure. A single MySQL server can only be scaled vertically by increasing hardware size, which has its limits. That’s two good reasons to migrate from a single MySQL server to a cluster of MySQL servers. However, in cloudy white christmas times, few appreciate the extra work […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Wednesday, December 14th, 2011
Christmas time, time for presents! Version 1.2.0-alpha of the free and open source PHP mysqlnd replication and load balancing plugin has been made available on PECL. PECL/mysqlnd_ms makes using any kind of MySQL database cluster easier featuring:
Read-write splitting: automatic, SQL hints, can be disabled
Load balancing: random, round robin, user defined
Fail over
Global transaction ID […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Monday, December 5th, 2011
What if your PHP application could tell the mysqlnd library what service quality you need when using a MySQL replication cluster? If you wanted read-your-writes, the driver would select replication nodes for you which can offer it. If you can allow replication lag but no more than three seconds, the driver would select… One function […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Tuesday, November 29th, 2011
The MySQL administration SQL command SHOW PROCESSLIST may read "Waiting for table metadata lock" in its "State" column for a statement. The statement in question is waiting for another transaction to release a metadata lock. Its a state that may appear when using the global transaction ID injection feature of PECL/mysqlnd_ms 1.2.0-alpha. But only […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Wednesday, November 16th, 2011
The catchy theme/motto of the PECL/mysqlnd_ms 1.2 release will be Global Transaction ID support. Hidden behind the buzzword are two features. We will allow users to request a certain level of service from the replication cluster (keyword: consistency) and we will do basic global transaction ID injection to help with master failover. Failover refers […]
Posted in PlanetMySQL (english), PlanetPHP (english) | 2 Comments (read more) »
Thursday, November 10th, 2011
Elastic, fantastic: click here to add a MySQL replication database cluster to your cloud configuration. Click - yes, we can! Just one little thing, you need to update your application: consistency model changed. Plan for it. Some thoughts for PECL/mysqlnd_ms 1.x, the PHP mysqlnd replication plugin.
Problem: C as in ACID is no more
A MySQL […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Wednesday, November 9th, 2011
The mysqli quickstart series is coming to an end. Today, the post is about non-prepared statements. You may also want to check out the following related blog posts:
Using MySQL prepared statements with PHP mysqli
Using MySQL multiple statements with PHP mysqli
Using MySQL stored procedures with PHP mysqli
Using mysqli to execute statements
Statements can be executed by […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Tuesday, November 8th, 2011
Opening a database connection is a boring tasks. But do you know how defaults are determined, if values are omitted? Or, did you know there are two flavours of persistent connections in mysqli? Of course you, as a german reader, know it. I blogged about it in 2009 over at phphatesme.com (Nimmer Ärger mit den […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Monday, November 7th, 2011
The series Using X with PHP mysqli continues. After notes on calling stored procedures and using prepared statements, its time for a multiple statement quickstart. A mighty tool, if used with care…
Using Multiple Statements with mysqli
MySQL optionally allows having multiple statements in one statement string. Sending multiple statements at once reduces client-server round trips […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Friday, November 4th, 2011
PECL/mysqlnd 1.1.2-stable has been released. The mysqlnd replication and load balancing plugin for PHP 5.3/5.4 finally got the download label it deserves: stable, ready for production use! PECL/mysqlnd_ms makes using any kind of MySQL database cluster easier.
Download PECL/mysqlnd from pecl.php.net
Documentation at the PHP Reference Manual
Key features
The release motto of the 1.1 series is “cover MySQL […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Friday, November 4th, 2011
Starting with PHP mysqli is easy, if one has some SQL and PHP skills. To get started one needs to know about the specifics of MySQL and a few code snippets. Using MySQL stored procedures with PHP mysqli has found enough readers to begin with a “quickstart” or “how-to” series. Take this post with a […]
Posted in PlanetMySQL (english), PlanetPHP (english) | 2 Comments (read more) »
Thursday, November 3rd, 2011
A couple of weeks ago a friend of mine asked me how to use MySQL stored procedures with PHP’s mysqli API. Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored […]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off
Monday, October 24th, 2011
The free Mysqlnd replication and load balancing plugin now offers load balancing and lazy connections independent of read write splitting. This makes the plugin attractive for MySQL Cluster users. All nodes participating in a MySQL Cluster can serve all requests, they all accept read and write requests. No statement redirection needs to be done. […]
Posted in PlanetMySQL (english), PlanetPHP (english) | 1 Comment »
Tuesday, October 18th, 2011
Would you like to see the EXPLAIN output for all MySQL queries of any PHP application without changing the application much? Easy-peasy: compile PHP to use the mysqlnd library, install PECL/mysqlnd_uh and paste 22 lines of evil code into your auto_prepend_file .
class conn_proxy extends MysqlndUhConnection {
public function query($conn, $query, $self = false) {
[…]
Posted in PlanetMySQL (english), PlanetPHP (english) | Comments Off