<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Abhi&#039;s Weblog &#187; SQLite</title>
	<atom:link href="http://abhinavsingh.com/blog/tag/sqlite/feed/" rel="self" type="application/rss+xml" />
	<link>http://abhinavsingh.com/blog</link>
	<description>PHP, Memcached, XMPP and Web Development</description>
	<lastBuildDate>Mon, 27 Feb 2012 09:12:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Introducing MemChat: Open source group chat framework in PHP supporting Memcached, APC, SQLite, Flat Files and MySQL</title>
		<link>http://abhinavsingh.com/blog/2009/11/introducing-memchat-open-source-group-chat-framework-in-php-supporting-memcached-apc-sqlite-flat-files-and-mysql/</link>
		<comments>http://abhinavsingh.com/blog/2009/11/introducing-memchat-open-source-group-chat-framework-in-php-supporting-memcached-apc-sqlite-flat-files-and-mysql/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 22:01:07 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[Open Source Projects]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[JAXL]]></category>
		<category><![CDATA[MemBurger]]></category>
		<category><![CDATA[Memcache]]></category>
		<category><![CDATA[MemChat]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHProfane]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=548</guid>
		<description><![CDATA[MemChat is an open source group chat framework for personal and enterprise level websites. Written in PHP, MemChat can be configured to run with Memcached, APC, SQLite, Flat files and MySQL as it&#8217;s storage engine. With memcached, APC and Flat files serving as temporary storages and MySQL, SQLites being permanent storage engines. MemChat uses MemBurger [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F11%2Fintroducing-memchat-open-source-group-chat-framework-in-php-supporting-memcached-apc-sqlite-flat-files-and-mysql%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F11%2Fintroducing-memchat-open-source-group-chat-framework-in-php-supporting-memcached-apc-sqlite-flat-files-and-mysql%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=APC,JAXL,MemBurger,Memcache,MemChat,MySQL,PHProfane,SQLite&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://code.google.com/p/memchat">MemChat</a> is an open source group chat framework for personal and enterprise level websites. Written in <a href="http://php.net">PHP</a>, MemChat can be configured to run with <a href="http://danga.com/memcached">Memcached</a>, APC, SQLite, Flat files and MySQL as it&#8217;s storage engine. With memcached, APC and Flat files serving as temporary storages and MySQL, SQLites being permanent storage engines.</p>
<p>MemChat uses <a href="http://code.google.com/p/memburger">MemBurger</a> API for storing all the incoming messages in the storage engine. MemBurger is an open source PHP wrapper for all the storage engines mentioned above providing Collapsed Forwarding and <a href="http://www.mnot.net/drafts/draft-nottingham-http-stale-while-revalidate-00.txt">Stale-While-Revalidate</a> functionality.</p>
<p>MemChat can also be configured to notify the site owners at various event handlers provided. e.g. In case of a wordpress blog, site owner might want to get notified when someone post a new message on one of the blog post. Infact developers can write plugins for custom event handlers. MemChat provides two kind of notification methods. By default, MemChat uses <a href="http://xmpp.org">XMPP</a> protocol to notify blog owners. For these kind of notifications, <a href="http://code.google.com/p/jaxl">JAXL</a> an open source Jabber XMPP Client Library is used to send instant messages as notifications. MemChat can also be configured to send notifications using SMTP protocol a.k.a EMail.</p>
<p>MemChat also comes with a profanity word filter using <a href="http://code.google.com/p/phprofane">PHProfane</a> library i.e. one can configure MemChat to block all spam messages posted in the chat rooms. Developers can write a plugin to add custom spam words in the profanity filter.</p>
<p><strong style="font-size:18px;"><u>MemChat Flow Diagram:</u></strong><br />
Below is a flow diagram showing how all the above components are clubbed in as MemChat:<br />
<img src="http://abhinavsingh.com/blog/wp-content/uploads/2009/11/Slide2.jpg" alt="MemChat Workflow Diagram" title="MemChat Workflow Diagram" width="720" height="540" class="size-full wp-image-549" /></p>
<p><strong style="font-size:18px;"><u>MemChat use cases:</u></strong><br />
MemChat framework requires a unique alphanumeric id for each group you want to create. For example, WordPress blog makes a good environment to setup MemChat since every blog post have a unique id. Hence to setup MemChat on a wordpress blog all we need to do is, call
<pre class="php" name="code">$memchat_ui_html = memchat_init($memchat_group_id);</pre>
<p> method, where $memchat_group_id = Blog post id.</p>
<p>Similarly MemChat can be setup on a number of places as listed below:</p>
<ol>
<li><strong>Forums:</strong> Since each forum have a unique id per discussion thread, MemChat suits well here. Forum owners can setup MemChat for allowing current viewing users of the thread to chat in real time. If using temporary storage engines (since they scale up well), forum owners can easily write event handlers to save chat messages asynchronously so that interesting discussions can be made a part of actual discussion thread.</li>
<li><strong>Social Networking Websites:</strong> A social network will generally have group pages, fan pages, event pages and application pages. Since all pages will have a unique id associated with them, MemChat is a good fit here. Simply pass $blog_id = &#8220;group-1234&#8243;, for setting up a chat room on group page having id 1234. Similarly for fan, event and application pages.</li>
<li><strong>Blogs:</strong> A blog as discussed above is a perfect place for setting up MemChat. WordPress blog owners will be able to setup MemChat on their blog using <a href="http://plugins.svn.wordpress.org/wp-chat/">WP-Chat plugin</a>.</li>
</ol>
<p><strong style="font-size:18px;"><u>Setting up MemChat in 3 steps:</u></strong><br />
MemChat can be setup in 3 simple steps:</p>
<ol>
<li><strong>Download:</strong> <a href="http://code.google.com/p/memchat">MemChat</a> is hosted on Google Code.</li>
<li><strong>Update Configuration:</strong> Update MemChat config file to setup various default behavior and actions.</li>
<li><strong>Initialize:</strong> Include MemChat class file in your PHP template.
<pre class="php" name="code">include_once("/path/to/memchat.class.php")</pre>
<p> Next simply initialize MemChat
<pre class="php" name="code">$memchat_ui_html = memchat_init($memchat_group_id);</pre>
<p> which will return the user interface HTML code. Finally append it to your template and MemChat group is ready to serve.</li>
</ol>
<p>The ease of setup can be imagine from the fact that, <a href="http://plugins.svn.wordpress.org/wp-chat/">WP-Chat</a> wordpress plugin development required only the above 3 steps. I was able to develop the plugin within 5 minutes.</p>
<p><strong style="font-size:18px;"><u>MemChat Performance Benchmark</u></strong><br />
Initial benchmarking results show, On a single apache and single storage instance MemChat is capable of handling over 250 (MySQL) incoming chat messages per second. Capacity reaches in thousands when configured with Memcached or APC cache. Again Memcached configuration and APC no stat feature makes a difference in performance results.</p>
<p><strong style="font-size:18px;"><u>Why still in alpha?</u></strong><br />
Yes, MemChat is still in alpha release. I want to test all MemChat features on a live traffic and hence I chose my blog for its testing. I have installed MemChat on my blog which is currently using APC cache as storage medium. Over two weeks or so I will configure MemChat with various other storage engines to have a final round of test. Also the event handler and PHProfane plugin feature is still under development. MemBurger API also requires a more modular design pattern so that extending it for any other storage types become trivial.</p>
<p>Try out MemChat on my blog, can be seen as a facebook type chat bar below. This will be soon available as WP-Chat plugin for wordpress blogs. WP-Chat user interface is customizable just like wordpress themes.</p>
<p>Let me know your views and suggestions for improvement.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F11%2Fintroducing-memchat-open-source-group-chat-framework-in-php-supporting-memcached-apc-sqlite-flat-files-and-mysql%2F","http:\/\/code.google.com\/p\/memchat","http:\/\/php.net","http:\/\/danga.com\/memcached","http:\/\/code.google.com\/p\/memburger","http:\/\/www.mnot.net\/drafts\/draft-nottingham-http-stale-while-revalidate-00.txt","http:\/\/xmpp.org","http:\/\/code.google.com\/p\/jaxl","http:\/\/code.google.com\/p\/phprofane","http:\/\/plugins.svn.wordpress.org\/wp-chat\/","http:\/\/code.google.com\/p\/memchat","http:\/\/plugins.svn.wordpress.org\/wp-chat\/"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA5LzExL2ludHJvZHVjaW5nLW1lbWNoYXQtb3Blbi1zb3VyY2UtZ3JvdXAtY2hhdC1mcmFtZXdvcmstaW4tcGhwLXN1cHBvcnRpbmctbWVtY2FjaGVkLWFwYy1zcWxpdGUtZmxhdC1maWxlcy1hbmQtbXlzcWwvPHdwdGI%2BSW50cm9kdWNpbmcgTWVtQ2hhdDogT3BlbiBzb3VyY2UgZ3JvdXAgY2hhdCBmcmFtZXdvcmsgaW4gUEhQIHN1cHBvcnRpbmcgTWVtY2FjaGVkLCBBUEMsIFNRTGl0ZSwgRmxhdCBGaWxlcyBhbmQgTXlTUUw8d3B0Yj5odHRwOi8vYWJoaW5hdnNpbmdoLmNvbS9ibG9nPHdwdGI%2BQWJoaSYjMDM5O3MgV2VibG9n";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2009/01/mysql-query-cache-wp-cache-apc-memcache-what-to-choose/" title="MySQL Query Cache, WP-Cache, APC, Memcache &#8211; What to choose">MySQL Query Cache, WP-Cache, APC, Memcache &#8211; What to choose</a> (44)</li><li><a href="http://abhinavsingh.com/blog/2010/07/introducing-wp-chat-xmpp-chat-plugin-for-wordpress/" title="Introducing WP-Chat :: XMPP Chat plugin for Wordpress">Introducing WP-Chat :: XMPP Chat plugin for Wordpress</a> (48)</li><li><a href="http://abhinavsingh.com/blog/2011/04/jaxl-library-list-of-available-hooks-for-various-xmpp-events/" title="JAXL library &#8211; List of available hooks for various XMPP events">JAXL library &#8211; List of available hooks for various XMPP events</a> (4)</li><li><a href="http://abhinavsingh.com/blog/2010/08/how-to-write-external-jabber-components-in-php-using-jaxl-library/" title="How to write External Jabber Components in PHP using Jaxl library?">How to write External Jabber Components in PHP using Jaxl library?</a> (15)</li><li><a href="http://abhinavsingh.com/blog/2010/08/xep-0045-%e2%80%93-multi-user-chat-muc-available-methods-in-jaxl-2-0/" title="XEP 0045 – Multi User Chat (MUC) available methods in Jaxl 2.0">XEP 0045 – Multi User Chat (MUC) available methods in Jaxl 2.0</a> (19)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2009/11/introducing-memchat-open-source-group-chat-framework-in-php-supporting-memcached-apc-sqlite-flat-files-and-mysql/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>

