<?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>Mon, 20 May 2013 22:20:47 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Database connection pooling with PHP and React (node.php)]]></title>
      <guid>http://www.phpdeveloper.org/news/17983</guid>
      <link>http://www.phpdeveloper.org/news/17983</link>
      <description><![CDATA[<p>
In <a href="http://gonzalo123.wordpress.com/2012/05/21/database-connection-pooling-with-php-and-react-node-php/">this latest post</a> <i>Gonzalo Ayuso</i> his recent experiences with <1 href="http://nodephp.org/">React</a> (Node.js in PHP) and an example of how he worked up a script to pool database connections.
</p>
<blockquote>
Last saturday I meet a new hype: "<a href="http://nodephp.org/">React</a>" also known as "node.php". Basically it's the same idea than node.js but built with PHP instead of javascript. [...] Basically I want to create a database connection pooling. It's one of the things that I miss in PHP. I wrote a post here some time ago with this idea with one exotic experiment building one <a href="http://gonzalo123.wordpress.com/2010/11/01/database-connection-pooling-with-php-and-gearman/">connection pooling using gearman</a>. Today the idea is the same but now with React.
</blockquote>
<p>
He includes the sample script, also including the line to add to your composer.json file to install React and the SQL to create the sample tables. The script makes a PDO connection and assigns it to the pool, an instance of his "CPool" class. If you want to try it out, you can find the code <a href="https://github.com/gonzalo123/CPool">over on github</a>.
</p>]]></description>
      <pubDate>Mon, 21 May 2012 10:19:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Database connection pooling with PHP and gearman]]></title>
      <guid>http://www.phpdeveloper.org/news/15360</guid>
      <link>http://www.phpdeveloper.org/news/15360</link>
      <description><![CDATA[<p>
<i>Gonzalo Ayuso</i> has a new post to his blog today looking at using the <a href="http://gearman.org/">Gearman</a> tool to <a href="http://gonzalo123.wordpress.com/2010/11/01/database-connection-pooling-with-php-and-gearman/">pool database connections</a> for his application and make them available for easy reuse.
</p>
<blockquote>
Handling Database connections with PHP is pretty straightforward. Just open database connection, perform the actions we need, and close it. There's a little problem. We cannot create a pool of database connections. We need to create the connection in every request. Create and destroy, again and again. [...] In this post I'm going to try to explain a personal experiment to create a connection pooling using <a href="http://gearman.org/">gearman</a>.
</blockquote>
<p>
He includes a basic database connection example with PDO, logging into a single database and fetching all of the results. To integrate this into the gearman functionality, he creates a configuration class to hold connection details and the <a href="http://code.google.com/p/php-pool/source/browse/worker/worker.php">worker</a> code (along with some libraries to help manage the connections) that gets the results, serializes them and returns them back to the calling script.
</p>]]></description>
      <pubDate>Mon, 01 Nov 2010 09:07:51 -0500</pubDate>
    </item>
  </channel>
</rss>
