<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Memcached and &quot;N&quot; things you can do with it &#8211; Part 1</title>
	<atom:link href="http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/feed/" rel="self" type="application/rss+xml" />
	<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/</link>
	<description>PHP, Memcached, XMPP and Web Development</description>
	<lastBuildDate>Thu, 10 May 2012 07:30:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Jenny Phillipe</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-82258</link>
		<dc:creator>Jenny Phillipe</dc:creator>
		<pubDate>Fri, 04 Nov 2011 06:56:47 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-82258</guid>
		<description>EITHER:

■sudo apt-get install php5-memcache
■Go to /etc/php5/conf.d/memcache.ini and uncomment the line ;extension=memcache.so to enable this module

OR :

■sudo pecl install memcache
■Go to php.ini file and add this line: extension=memcache.so</description>
		<content:encoded><![CDATA[<p>EITHER:</p>
<p>■sudo apt-get install php5-memcache<br />
■Go to /etc/php5/conf.d/memcache.ini and uncomment the line ;extension=memcache.so to enable this module</p>
<p>OR :</p>
<p>■sudo pecl install memcache<br />
■Go to php.ini file and add this line: extension=memcache.so</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Per Persson</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-734</link>
		<dc:creator>Per Persson</dc:creator>
		<pubDate>Fri, 19 Mar 2010 15:05:04 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-734</guid>
		<description>Is it really possible to store a raw MySQL result in memcached, as you do when $options[&#039;type&#039;] == &quot;original&quot;? I&#039;ve tried, but it doesn&#039;t work for me.

Also, in databaseAPI, you try to execute code (to free the result set) after you have issued a return. That won&#039;t work, will it?</description>
		<content:encoded><![CDATA[<p>Is it really possible to store a raw MySQL result in memcached, as you do when $options['type'] == &#8220;original&#8221;? I&#8217;ve tried, but it doesn&#8217;t work for me.</p>
<p>Also, in databaseAPI, you try to execute code (to free the result set) after you have issued a return. That won&#8217;t work, will it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rohit</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-733</link>
		<dc:creator>rohit</dc:creator>
		<pubDate>Wed, 17 Mar 2010 06:46:29 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-733</guid>
		<description>gr8 work man!!!!!!!!!! really liked the specs u mentioned....gr8 help for beginners...thnx....keep faith.</description>
		<content:encoded><![CDATA[<p>gr8 work man!!!!!!!!!! really liked the specs u mentioned&#8230;.gr8 help for beginners&#8230;thnx&#8230;.keep faith.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Memcached in PHP on Dapper &#124; ProDevTips - dev notes and tutorials</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-732</link>
		<dc:creator>Memcached in PHP on Dapper &#124; ProDevTips - dev notes and tutorials</dc:creator>
		<pubDate>Mon, 08 Feb 2010 17:37:47 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-732</guid>
		<description>[...] Memchache class is based on Abhinav Singh&#8217;s Memcache class. You should read his article, it&#8217;s a good one, especially at the end where you get a few [...]</description>
		<content:encoded><![CDATA[<p>[...] Memchache class is based on Abhinav Singh&#8217;s Memcache class. You should read his article, it&#8217;s a good one, especially at the end where you get a few [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhinav Singh&#8217;s Blog: MEMQ : Fast queue implementation using Memcached and PHP only &#124; Webs Developer</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-731</link>
		<dc:creator>Abhinav Singh&#8217;s Blog: MEMQ : Fast queue implementation using Memcached and PHP only &#124; Webs Developer</dc:creator>
		<pubDate>Mon, 08 Feb 2010 16:01:26 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-731</guid>
		<description>[...]   Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this [...]</description>
		<content:encoded><![CDATA[<p>[...]   Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhinav Singh&#8217;s Blog: MEMQ : Fast queue implementation using Memcached and PHP only &#124; Development Blog With Code Updates : Developercast.com</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-730</link>
		<dc:creator>Abhinav Singh&#8217;s Blog: MEMQ : Fast queue implementation using Memcached and PHP only &#124; Development Blog With Code Updates : Developercast.com</dc:creator>
		<pubDate>Mon, 08 Feb 2010 15:22:50 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-730</guid>
		<description>[...]   Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this [...]</description>
		<content:encoded><![CDATA[<p>[...]   Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MEMQ : Fast queue implementation using Memcached and PHP only &#124; Abhi&#39;s Weblog</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-729</link>
		<dc:creator>MEMQ : Fast queue implementation using Memcached and PHP only &#124; Abhi&#39;s Weblog</dc:creator>
		<pubDate>Sun, 07 Feb 2010 14:16:32 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-729</guid>
		<description>[...] topic.Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this [...]</description>
		<content:encoded><![CDATA[<p>[...] topic.Memcached is a scalable caching solution developed by Danga interactive. One can do a lot of cool things using memcached including spam control, online-offline detection of users, building scalable web services. In this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: p23</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-728</link>
		<dc:creator>p23</dc:creator>
		<pubDate>Sat, 06 Feb 2010 03:39:11 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-728</guid>
		<description>Great. Thanks a lot.
i&#039;ll try to find it out</description>
		<content:encoded><![CDATA[<p>Great. Thanks a lot.<br />
i&#8217;ll try to find it out</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhinav Singh</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-727</link>
		<dc:creator>Abhinav Singh</dc:creator>
		<pubDate>Fri, 05 Feb 2010 12:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-727</guid>
		<description>Alright. So in such cases you make $key = md5($query1). On first fetch you save the key in memcached e.g. $mem-&gt;set($key, $resultset1)

From this point, before fetching $query1 from the database, you always check if $key = md5($query1) exists. If yes return from cache else from database.

Also, if a new employee record is entered in employees table, you can proceed in many ways. 2 possible cases are as follows:

1) Store new employee data in the table, then you repopulate the cache $key = md5($query). In such cases you might also have to additionally maintain a list of SQL queries which are interacting with employees table. So that you update all related cache keys on table update.

2) Another method of doing such things is to have a copy of your employee table in memcached, in such a way that you can always retrieve desired information directly from memcached. When a new employee is added in database table, you simply add that in memcached also.

There are various open source projects now available which makes such task simple and efficient without using mysql (the bottleneck). MongoDb and Redis are two which I have used.</description>
		<content:encoded><![CDATA[<p>Alright. So in such cases you make $key = md5($query1). On first fetch you save the key in memcached e.g. $mem-&gt;set($key, $resultset1)</p>
<p>From this point, before fetching $query1 from the database, you always check if $key = md5($query1) exists. If yes return from cache else from database.</p>
<p>Also, if a new employee record is entered in employees table, you can proceed in many ways. 2 possible cases are as follows:</p>
<p>1) Store new employee data in the table, then you repopulate the cache $key = md5($query). In such cases you might also have to additionally maintain a list of SQL queries which are interacting with employees table. So that you update all related cache keys on table update.</p>
<p>2) Another method of doing such things is to have a copy of your employee table in memcached, in such a way that you can always retrieve desired information directly from memcached. When a new employee is added in database table, you simply add that in memcached also.</p>
<p>There are various open source projects now available which makes such task simple and efficient without using mysql (the bottleneck). MongoDb and Redis are two which I have used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: p23</title>
		<link>http://abhinavsingh.com/blog/2009/01/memcached-and-n-things-you-can-do-with-it/comment-page-1/#comment-726</link>
		<dc:creator>p23</dc:creator>
		<pubDate>Fri, 05 Feb 2010 10:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=186#comment-726</guid>
		<description>Nice &amp; i successfully try it on my apache n mysql. But, how do i invalidate items in memcache after the database has been written?

Let say i put these 2 line in index.php

$query1 = &quot;SELECT * FROM employees WHERE gender=&#039;M&#039; LIMIT 0,50&quot;;
$resultset1 = $mdb-&gt;getData($query1);

This will gives result of 10 records;

After a while i insert a new record with id=x

So, how do i invalidate the $query than was cached recently. Thus, if user invoke the $query1, it will get new record with 11 records.</description>
		<content:encoded><![CDATA[<p>Nice &amp; i successfully try it on my apache n mysql. But, how do i invalidate items in memcache after the database has been written?</p>
<p>Let say i put these 2 line in index.php</p>
<p>$query1 = &#8220;SELECT * FROM employees WHERE gender=&#8217;M&#8217; LIMIT 0,50&#8243;;<br />
$resultset1 = $mdb-&gt;getData($query1);</p>
<p>This will gives result of 10 records;</p>
<p>After a while i insert a new record with id=x</p>
<p>So, how do i invalidate the $query than was cached recently. Thus, if user invoke the $query1, it will get new record with 11 records.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

