<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 19 Jun 2013 01:51:41 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Johannes Schl&uuml;ter: MySQL, Memcache, PHP revised]]></title>
      <guid>http://www.phpdeveloper.org/news/18541</guid>
      <link>http://www.phpdeveloper.org/news/18541</link>
      <description><![CDATA[<p>
<i>Johannes Schl&uuml;ter</i> has a recent post highlighting an <a href="http://schlueters.de/blog/archives/169-MySQL,-Memcache,-PHP-revised.html">interesting PHP extension</a> that can connect memcache with your MySQL server via PHP, the <a href="http://pecl.php.net/mysqlnd_memcache">PECL mysqlnd_memcache</a> extension.
</p>
<blockquote>
Now this blog entry is tagged a	s PHP. Hs is that coming into play? - Well, on the one side we have this fast memcache interface, which allows to access almost arbitrarry data from the database. On the other side we have our PHP mysqlnd plugin interface where we can add special features, like query caching or load balancing, transparently to any PHP application. Why not combine those two things? - Good question. That's what we have done in the <a href="http://pecl.php.net/mysqlnd_memcache">PECL mysqlnd_memcache</a> PHP extension.
</blockquote>
<p>
He includes some sample PHP code showing it in action - two examples: one using the "mysqlnd_memcache_set" method to set a memcache server on the MySQL connection and another showing two queries and how they're handled behind the scenes by this driver plugin.
</p>]]></description>
      <pubDate>Tue, 02 Oct 2012 09:27:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulf Wendel's Blog: PHP mysqlnd query cache plugin quickstart is online!]]></title>
      <guid>http://www.phpdeveloper.org/news/17413</guid>
      <link>http://www.phpdeveloper.org/news/17413</link>
      <description><![CDATA[<p>
In a new post to his blog <i>Ulf Wendel</i> has pointed out that the <a href="http://blog.ulf-wendel.de/2012/php-mysqlnd-query-cache-plugin-quickstart-is-online/">mysqlnd query cache plugin quickstart is posted</a> on the <a href="http://docs.php.net/manual/en/mysqlnd-qc.quickstart.php">docs.php.net</a> site.
</p>
<blockquote>
New in the PHP manual: a <a href="http://docs.php.net/manual/en/mysqlnd-qc.quickstart.php">quickstart for the mysqlnd query cache plugin</a>. PECL/mysqlnd_qc, the mysqlnd query cache plugin, is transparent and ease to use. But, how? Some pointers have been given in assorted <A href="http://blog.ulf-wendel.de/2012/php-mysqlnd-query-cache-plugin-quickstart-is-online/www.slideshare.net/nixnutz/">presentations</a>, here on my blog and in some, few examples from the manual. Fixed. You can now browse a quickstart to gain a quick overview.
</blockquote>
<p>
The <a href="http://pecl.php.net/package/mysqlnd_qc">query cache plugin</a> can replace the query caching MySQL does and can help with things like multiple storage options (memory, APC, Memcache, etc) and almost no changes to your application. There's also a method (mysqlnd_qc_get_query_trace_log) that comes with the plugin that gives you a "stack trace" of every query run through the MySQL interface. 
</p>]]></description>
      <pubDate>Wed, 18 Jan 2012 12:12:21 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schl&#252;ter's Blog: Symfony 2 and mysqlnd]]></title>
      <guid>http://www.phpdeveloper.org/news/16938</guid>
      <link>http://www.phpdeveloper.org/news/16938</link>
      <description><![CDATA[<p>
<i>Johannes Schl&#252;ter</i> has <a href="http://schlueters.de/blog/archives/161-Symfony-2-and-mysqlnd.html">a new post to his blog</a> today about a bundle he's created for the Symfony2 framework that integrates some of the advanced statistics <a href="http://php.net/mysqlnd">mysqlnd</a> provides back to the framework's profiler tool - <a href="http://github.com/johannes/JSMysqlndBundle">JSMysqlndBundle</a>.
</p>
<blockquote>
Symfony provides a nice feature, which is the Symfony Profilier, an extensive logging and reporting system for Symfony developers to understand what's going on. A part of it is the Doctrine query logger which lists all database queries executed by Doctrine and their execution time. This is nice but when we're using mysqlnd in our PHP build we have more information available. "So why not use that information," I thought and built a new bundle for Symfony 2 doing exactly that.
</blockquote>
<p>
His bundle takes the <a href="http://php.net/mysqlnd.stats">"150 or so" statistics</a> and <a href="http://schlueters.de/blog/uploads/screenshots/symfony_mysqlnd.png">drops them into the profiler</a>, giving you even more insight into how your script is running. The bundle is <a href="https://github.com/johannes/JSMysqlndBundle">available on github</a>, making it simpler to fork and extend to add other features (some he suggests include caching and replication decisions using information from other mysqlnd plugins).
</p>]]></description>
      <pubDate>Mon, 03 Oct 2011 09:22:52 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Ulf Wendel's Blog: PECL/mysqlnd_ms compared to a classic]]></title>
      <guid>http://www.phpdeveloper.org/news/16918</guid>
      <link>http://www.phpdeveloper.org/news/16918</link>
      <description><![CDATA[<p>
<i>Ulf Wendel</i> has a new post that <a href="http://blog.ulf-wendel.de/?p=318">compares the performance</a> of a classic method for using the mysqlnd plugin in MySQL replication to <a href=http://de2.php.net/mysqlnd_ms">mysqlnd_ms</a>, the replication and load balancing plugin for the mysqlnd driver (that works with the mysql and mysqli functionality and is, as of <a href="http://phpdeveloper.org/news/16913">this beta</a> of PHP, the default driver for MySQL connections).
</p>
<blockquote>
Recently I was asked if <a href="http://de2.php.net/mysqlnd_ms">PECL/mysqlnd_ms</a> should be used to add MySQL replication support to a yet to be developed PHP application. The <a href="http://blog.ulf-wendel.de/php.net/mysqlnd">mysqlnd</a> plugin, which supports all PHP MySQL extensions (PDO, mysqli, mysql), stood up against a classical, simple, proven and fast approach: one connection for reads, one connection for writes. Let's compare. This is a bit of an unfair challenge, because PECL/mysqlnd_ms was designed as a drop-in for existing applications, not optimized for those starting from scratch, *yell*... The plugin stands up quite well, anyway!
</blockquote>
<p>
He starts with a look at the "classical pattern" of using a factory or singleton to make a database object instance that gives back different connections for reads versus writes (slave vs master). The mysqlnd_ms plugin allows you to define configuration settings to tell the queries to automatically go to certain places for different actions. For example, you could use "master_on_write" to tell it to use a master node if you're doing an INSERT or UPDATE versus a SELECT. He also shows a more complex example using a SQL hint and one issue that might come from the "human element" - not paying attention to database character sets.
</p>]]></description>
      <pubDate>Wed, 28 Sep 2011 08:43:57 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schluter's Blog: mysqlnd plugins and json]]></title>
      <guid>http://www.phpdeveloper.org/news/16858</guid>
      <link>http://www.phpdeveloper.org/news/16858</link>
      <description><![CDATA[<p>
<i>Johannes Schluter</i> has <a href="http://schlueters.de/blog/archives/159-mysqlnd-plugins-and-json.html">shared a handy mysqlnd plugin</a> that he's written up that does two common things at once when you're pulling data from your database and pushing it into JSON - a mysqlnd_query_to_json function.
</p>
<blockquote>
In my spare time I'm currently writing a shiny Web 2.0 application where I'm heavily using AJAX-like things, so what I do quite often in this application is, basically this: Check some pre-conditions (permissions etc.) then select some data from the database, do a fetch_all to get the complete result set as an array and run it through json_encode; Of course that example is simplified as I'm using the Symfony 2 framework for this project. [...] So I wrote a mysqlnd plugin.
</blockquote>
<p>
His plugin (that he admits is "a hack") <a href="http://schlueters.de/blog/uploads/code/mysqlnd_query_to_json.tar.bz2">gives you the mysqlnd_query_to_json function</a> that automagically transforms the results from the passed in query into JSON output. He notes some things lacking - like Unicode encoding and no MySQL bitfield support.
</p>]]></description>
      <pubDate>Wed, 14 Sep 2011 11:04:48 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: MySQLND, MySQL_UH and other goodies available to PHP programmers]]></title>
      <guid>http://www.phpdeveloper.org/news/15810</guid>
      <link>http://www.phpdeveloper.org/news/15810</link>
      <description><![CDATA[<p>
On the Zend Developer Zone today there's <a href="http://devzone.zend.com/article/12982-MySQLND-MySQL_UH-and-other-goodies-available-to-PHP-programmers">a new post</a> from <i>Cal Evans</i> mentioning some goodies that are available to PHP programmers in the world of MySQL.
</p>
<blockquote>
PHP 5.3 shipped with a new driver for MySQL, mysqlnd or MySQL Native Driver. While one of it's biggest features is that it gives us a mysql driver that is part of PHP so it doesn't suffer from licensing issues that the previous driver did. However, in the redesign, the architecture was changed. 
</blockquote>
<p>
He mentions the <a href="http://pecl.php.net/package/mysqlnd_uh">mysqlnd_uh</a> that's a part of this new MySQL driver and <a href="http://blog.ulf-wendel.de/?p=298">an interesting article</a> from <i>Ulf Wendel</i> about its use in transparent load balancing and sharding. The article includes code that randomly picks a MySQL server for the script to use.
</p>
<blockquote>
The article is a bit difficult to read at time but trust me, stick with them because the stuff in there is the stuff you want in your head when you are working on your next application.
</blockquote>]]></description>
      <pubDate>Wed, 26 Jan 2011 11:16:02 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ThinkPHP Blog: MySQLnd Plugins: Writing a MySQL Query Logger in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/14981</guid>
      <link>http://www.phpdeveloper.org/news/14981</link>
      <description><![CDATA[<p>
On the ThinkPHP blog there's <a href="http://blog.mayflower.de/archives/578-MySQLnd-Plugins-Writing-a-MySQL-Query-Logger-in-PHP.html">a recent post</a> looking at writing a query logger in PHP as a mysqlnd plugin using the <a href="http://pecl.php.net/package/mysqlnd_uh/">mysqlnd_uh</a> extension.
</p>
<blockquote>
A new approach to implementing a query logger and potentially more complex features such as monitoring or read/write-splitting is the MySQLnd Userland Handler Extension (mysqlnd_uh, <a href="http://pecl.php.net/package/mysqlnd_uh/">pecl website</a>). The extension lets you register a PHP class as a proxy for every <a href="http://docs.php.net/manual/en/book.mysqlnd.php">MySQLnd</a> connection. Every call to a function to MySQLnd (usually indirect through mysqli, mysql, pdo_mysql) is passed to the PHP class, which then calls the original MySQLnd function.
</blockquote>
<p>
They give a simple example to start - a logging function and how to configure it - followed by a more real-world scenario of logging inside of a project plugin.
</p>]]></description>
      <pubDate>Wed, 18 Aug 2010 11:10:15 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Internet Super Hero Blog: PHP: 120 tuning screws for mysqlnd]]></title>
      <guid>http://www.phpdeveloper.org/news/13371</guid>
      <link>http://www.phpdeveloper.org/news/13371</link>
      <description><![CDATA[<p>
New on the Internet Super Hero blog today <i>Ulf Wendel</i> has a <a href="http://blog.ulf-wendel.de/?p=268">huge post</a> with a complete listing of all one hundred and twenty different kinds of statistics that the <a href="http://dev.mysql.com/downloads/connector/php-mysqlnd/">mysqlnd</a> driver for PHP can gather during its connections:
</p>
<blockquote>
This is about twice as much as it was when I blogged about the <a href="http://blog.ulf-wendel.de/?p=163">59 tuning screws for mysqlnd</a>. While the basics have not not changed and the API calls for accessing the data remained the same (<a href="http://blog.ulf-wendel.de/?p=163">see previous posting</a>) the new figures have never been described before. 
</blockquote>
<p>
Each of the items on the list is described and some include some sample use cases. Here's just a few:
</p>
<ul>
<li>packets_sent, packets_received
<li>bytes_received_eof_packets, packets_received_eof
<li>bytes_received_rset_field_meta_packet, packets_received_rset_field_metabytes_received_change_user_packet, packets_received_change_user
<li>result_set_queries
<li>slow_queries
<li>flushed_normal_sets, flushed_ps_sets
<li>rows_fetched_from_client_ps_cursor
<li>connect_success, connect_failure
<li>in_middle_of_command_close
<li>command_buffer_too_small
</ul>]]></description>
      <pubDate>Mon, 12 Oct 2009 09:34:35 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Giri Mandalika's Sun Blog: MySQL Native Driver for PHP, mysqlnd]]></title>
      <guid>http://www.phpdeveloper.org/news/11764</guid>
      <link>http://www.phpdeveloper.org/news/11764</link>
      <description><![CDATA[<p>
<a href="http://phpimpact.wordpress.com/2009/01/18/sun-mysql-native-driver-for-php/">This new post</a> on the PHP::Impact blog links to a Sun blog post about the MySQL driver that provides a more direct connection between your PHP instance and MySQL - <a href="http://blogs.sun.com/mandalika/entry/mysql_native_driver_for_php">mysqlnd</a>.
</p>
<blockquote>
Due to the tight integration into PHP 5.3 (and later), mysqlnd eliminates the dependency on the MySQL client programming support when the database extension(s) and the database driver are built with the support for mysqlnd. mysqlnd is not another PHP extension like mysqli nor it has an exposed API to the userland. It is a library that provides almost similar functionality as that of the MySQL client library, libmysql. mysqlnd and libmysql libraries implement the MySQL communication protocol - hence both of those libraries can be used to connect to the MySQL Server.
</blockquote>
<p>
The <a href="http://blogs.sun.com/mandalika/entry/mysql_native_driver_for_php">Sun blog entry</a> also walks you through the installation and configuration of a PHP instance with the native driver installed (with the upcoming PHP version, 5.3).
</p>]]></description>
      <pubDate>Mon, 19 Jan 2009 10:26:37 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Johannes Schluter's Blog: Direct MySQL Stream Access]]></title>
      <guid>http://www.phpdeveloper.org/news/11350</guid>
      <link>http://www.phpdeveloper.org/news/11350</link>
      <description><![CDATA[<p>
In a <a href="http://schlueters.de/blog/archives/86-Direct-MySQL-Stream-Access.html">recent post</a> to his blog <i>Johannes Schluter</i> looks at how you can use the new experimental MySQL driver for PHP, <a href="http://forge.mysql.com/wiki/PHP_MYSQLND">mysqlnd</a>, and get into the streams that connect PHP and your MySQL database connections.
</p>
<blockquote>
Ever wondered what your PHP application and MySQL actually do? An <a href="https://code.launchpad.net/~johannes-s/php-mysqlnd/mysqli-to-stream">experimental mysqlnd branch</a> will give you full access to the network communication stream. Using a custom PHP stream filter you can then intercept the communication.
</blockquote>
<p>
He shows how to attach a filter on to the stream and what sort of output it would give for a query that wasn't valid SQL (including all of the "behind the scenes" queries that the database does to get table information from the schema).
</p>]]></description>
      <pubDate>Wed, 05 Nov 2008 11:18:57 -0600</pubDate>
    </item>
  </channel>
</rss>
