<?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>thinkAPI&#187; Sukumar</title>
	<atom:link href="http://thinkapi.com/blog/author/suku/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkapi.com/blog</link>
	<description>An interface to tech thoughts</description>
	<lastBuildDate>Fri, 06 Apr 2012 09:23:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Notes on &#8220;Distributed Erlang Systems In Operation: Patterns and Pitfalls&#8221;</title>
		<link>http://thinkapi.com/blog/notes_on_distributed_erlang_systems_in_operation/</link>
		<comments>http://thinkapi.com/blog/notes_on_distributed_erlang_systems_in_operation/#comments</comments>
		<pubDate>Thu, 05 Apr 2012 20:04:28 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Distributed Systems]]></category>
		<category><![CDATA[Distributed systems]]></category>
		<category><![CDATA[Riak]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=203</guid>
		<description><![CDATA[This is a summary of a talk by Andy Gross of Basho Technolgies titled &#8220;Distributed Erlang Systems In Operation: Patterns and Pitfalls&#8221; given at Erlang Factory SF Bay Area 2010 conference. While Erlang/OTP provides a rich set of abstractions and tools &#8230; <a href="http://thinkapi.com/blog/notes_on_distributed_erlang_systems_in_operation/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>This is a summary of a talk by <a title="Andy Gross" href="http://www.linkedin.com/in/andygross">Andy Gross</a> of <a title="Basho Technologies" href="http://basho.com/">Basho Technolgies</a> titled <a title="Distributed Erlang Systems In Operation: Patterns and Pitfalls" href="http://www.erlang-factory.com/conference/SFBay2010/speakers/AndyGross">&#8220;Distributed Erlang Systems In Operation: Patterns and Pitfalls&#8221;</a> given at <a title="Erlang Factory SF Bay Area 2010" href="http://www.erlang-factory.com/conference/SFBay2010">Erlang Factory SF Bay Area 2010</a> conference.<span id="more-203"></span></p>
<blockquote><p>While Erlang/OTP provides a rich set of abstractions and tools for developing distributed applications, the operation of a distributed Erlang system at scale presents many challenges and pitfalls that developers should be aware of at all phases of application development. In this talk, Andy will present a number of techniques for building operationally friendly Erlang systems that effectively use the OTP libraries, based on real-world experience at Mochi Media and Basho Technologies.</p></blockquote>
<h2><strong>Slides</strong></h2>
<p><strong></strong><a title="Distributed Erlang Systems In Operation: Patterns and Pitfalls Slides" href="http://www.erlang-factory.com/upload/presentations/248/ErlangFactorySFBay2010-AndyGross.pdf  ">Link</a></p>
<h2><strong>Video</strong></h2>
<p><iframe src="http://player.vimeo.com/video/12810455?title=0&amp;byline=0&amp;portrait=0" frameborder="0" width="398" height="299"></iframe></p>
<h2><strong>Notes</strong></h2>
<h2>Architectural goals</h2>
<p>Things to think about before writing code</p>
<ul>
<li>Decentralized: No single point of failure, no special nodes, all machines are equal</li>
<li>Distributed: Embrace the asynchronous nature (know that networks are inherently faulty), use local data</li>
<li>Homegenous: No node is special (removes burden from system operators)</li>
<li>Observable: Have different ways to inspect the system (a challenging goal)</li>
</ul>
<h2>Anti-goals</h2>
<p>Things that can affect the system adversely</p>
<ul>
<li>Global state: single master</li>
<ul>
<li><a title="Erlang pg/2" href="http://www.erlang.org/doc/man/pg2.html">pg/2</a> returned PIDs that were dead; clients were coded assuming pg/2 was reliable</li>
<li>hot data in <a title="Mnesia" href="http://www.erlang.org/doc/man/mnesia.html">mnesia</a>: network partitioning is risky (use <a title="Unsplit" href="http://github.com/uwiger/unsplit">unsplit</a>)</li>
</ul>
<li>Distributed transactions: used when we need temporary consensus: <a title="Two-phase commit protocol" href="http://en.wikipedia.org/wiki/Two-phase_commit_protocol">two phase</a>/<a title="Three-phase commit protocol" href="http://en.wikipedia.org/wiki/Three-phase_commit_protocol">three phase commit</a>, <a title="Paxos protocol" href="http://en.wikipedia.org/wiki/Paxos_algorithm">Paxos protocol</a>: (hard to implement); Drawbacks: hard to make guarantees on time and message complexity</li>
<li>Reliance on physical time: another type of global state (ntp/wall clock time), hard to synchronize computers. Work around: logical time (<a title="Lamport timestamps" href="http://en.wikipedia.org/wiki/Lamport_timestamps">lamport timestamps</a>, <a title="Vector clocks" href="http://en.wikipedia.org/wiki/Vector_clocks">vector clocks</a>): make decisions based on causal relationship between distributed actors; provides happened before relationship</li>
</ul>
<h2>Compromise</h2>
<p>All of these things not achievable at the same time</p>
<ul>
<li>Decentralization: Need to communicate with a central server for security/LDAP, authentication and authorization; cannot be completely decentralized</li>
<li>Distributed: similar as decentralization; requirement may be to provide synchronous RPC like service over an asynchronous system</li>
<li>Homogeneity: Performance reasons: Certain types of calculations may be needed to be run on certain types of systems</li>
<li>Distributed transactions/global state: purpose may be to provide a global state</li>
<li>Physical time: performance reasons/complexity reasons; cannot resolve every single conflict; unacceptable to push vector clock conflicts to clients; In Riak, when sibling objects are created: if vector clock don&#8217;t work, it uses physical time to break ties (optionally can be handled by the client)</li>
</ul>
<h2>System design</h2>
<p>Things that all distributed systems have in common</p>
<ul>
<li>Cluster membership: what nodes are members of the sytem; use a config files and synchronize it, not elastic enough; Riak: contact seed node and use <a title="Gossip protocol" href="http://en.wikipedia.org/wiki/Gossip_protocol">gossip protocol</a> to propogate to rest of the nodes (more complex). Know the tradeoffs, know the scope of the application, know what the system needs to deal with, don&#8217;t be architecture astronaut!</li>
<li>Load balancing/naming/resource allocation
<ul>
<li>Static assignment: simple system, based on config file, especially of knowledge of system avaulable beforehand; round robin/randon assingment: assumes all units of work are created equal which might overload some nodes</li>
<li>static hashing: sharding based approach, array of nodes, run hash function over it, works alright except in case of nodes coming and leaving cluster often which means lots of shifting of computations or data around the cluster</li>
<li>consistent hashing</li>
</ul>
</li>
<li>Liveliness checking: configure whether or not to send traffic to other nodes; good from operational perspective</li>
<li>Soft global state: gossip protocol: propogate update copy, logical timestamps help here; tradeoffs: design datastructure to deal with slightly out of date data, consistent hashing can help</li>
</ul>
<h2>Running the system</h2>
<h3>Shipping code</h3>
<ul>
<li>Don&#8217;t expect to have working erlang on end user machines</li>
<li>Ship code with embedded runtime and libraries</li>
<li>Put version/build info into the code: useful to track systems that may be out of date</li>
</ul>
<h3>Upgrading code</h3>
<ul>
<li>Hot code loading for small emergency fixes</li>
<li>Reboot node for new releases: provides nice deterministic point</li>
<li>Why not .appups: systems evolved/changed too fast; reboot is a good rest of resiliency</li>
</ul>
<h3>Debugging runtime systems</h3>
<ul>
<li>Erlang remote shell is good and powerful but have alternatives since it might die</li>
<li>run_erl (or even screen(1)) give you a backdoor for when -remsh fails</li>
<li>rebar makes it easy</li>
</ul>
<h3>Other people&#8217;s systems</h3>
<p>Running your Erlang code on other people&#8217;s systems</p>
<ul>
<li>Enterprise firewalls</li>
<li>Erlang shell is powerful but scary (for new users)</li>
<li>Remote debugging module with the code</li>
<li>Get data out using HTTP/SNMP/SMTP</li>
<li>Use disk log / report browser</li>
</ul>
<h2>Closing quote</h2>
<blockquote><p>“You know you have [a distributed system] when the crash of a computer you’ve never heard of stops you from getting any work done” -Leslie Lamport</p></blockquote>
<h2>Links</h2>
<ul>
<li>unsplit: <a title="Unsplit" href="http://github.com/uwiger/unsplit">http://github.com/uwiger/unsplit</a></li>
<li>gen_leader: <a title="gen_leader" href="http://github.com/KirinDave/gen_leader_revival">http://github.com/KirinDave/gen_leader_revival</a></li>
<li>Dynamo: <a title="Amazon Dynamo" href="http://www.allthingsdistributed.com/2007/10/amazons_dynamo.html">http://www.allthingsdistributed.com/2007/10/amazons_dynamo.html</a></li>
<li>Hans Svensson: Distributed Erlang Application Pitfalls and Recipes: <a title="Distributed Erlang Application Pitfalls and Recipes" href="http://www.erlang.org/workshop/2007/proceedings/ 06svenss.ppt">http://www.erlang.org/workshop/2007/proceedings/ 06svenss.ppt</a></li>
<li>Consistent Hashing and Random Trees: Distributed Caching Protocols for relieving Hot Spots on the World Wide Web: <a title="Consistent Hashing and Random Trees: Distributed Caching Protocols for relieving Hot Spots on the World Wide Web" href="http://bit.ly/LewinConsistentHashing">http://bit.ly/LewinConsistentHashing</a></li>
</ul>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/notes_on_distributed_erlang_systems_in_operation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Codeigniter clean URLs cleaner</title>
		<link>http://thinkapi.com/blog/making-codeigniter-clean-urls-cleaner/</link>
		<comments>http://thinkapi.com/blog/making-codeigniter-clean-urls-cleaner/#comments</comments>
		<pubDate>Mon, 10 May 2010 10:32:49 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[clean url]]></category>
		<category><![CDATA[codeigniter seo]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=192</guid>
		<description><![CDATA[Usually when working with codeigniter you come across the use case where you need to remove the extra &#8220;index&#8221; appearing in the URL for purposes ranging from shorter URLs to SEO. For example, As you can see, the difference in &#8230; <a href="http://thinkapi.com/blog/making-codeigniter-clean-urls-cleaner/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/' rel='bookmark' title='Codeigniter: Separating reads and writes for scaling MySQL'>Codeigniter: Separating reads and writes for scaling MySQL</a> <small>Generally websites average a ratio of 9:1 or more for...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Usually when working with codeigniter you come across the use case where you need to remove the extra &#8220;index&#8221; appearing in the URL for purposes ranging from shorter URLs to SEO.</p>
<p>For example,</p>
<pre class="brush: plain; title: ; notranslate">
Current URL style: http://example.com/controller/method/category1/category2/page-name
Target URL style: http://example.com/category1/category2/page-name.html
</pre>
<p><span id="more-192"></span><br />
As you can see, the difference in the target URL is the absence of the controller name and the method name and the presence of the extension &#8220;.html&#8221;. Now, lets see how to achieve this and why the extra extension is required.</p>
<p>Below is my version of .htaccess.</p>
<pre class="brush: plain; title: ; notranslate">
RewriteEngine on

RewriteRule ^([a-z0-9_-]+)\.html$ index.php/page/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|asset|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
</pre>
<p>The line that is extra is 3 which redirects all the requests for &#8220;.html&#8221; files to the controller named &#8220;page&#8221;.</p>
<p>Now, lets look at the page controller which will handle these requests.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Page extends Controller
    {

    function __construct()
    {
        parent::Controller();
    }

    function _remap()
    {
        $segment_count = $this-&gt;uri-&gt;total_segments();
        $segments = $this-&gt;uri-&gt;segment_array();

        if($segment_count == 0)
        {
            $this-&gt;data['title'] = 'UB Group Wines Division';
            $this-&gt;load-&gt;view('home', $this-&gt;data);
        }
        elseif($segment_count == 2) // Single page
        {
            $page_url = $segments[2];
            // Handle the page request
        }
        elseif($segment_count == 3) // Page with category
        {
            $category = $segments[2];
            $page_url = $segments[3];
            // Handle the category + page request
        }
    }
}
</pre>
<p>In this way you can have pages with smaller and cleaner URLs.</p>
<p><b>Tips:</b><br />
1. You can use any extension you like. e.g; in case you have static HTML files to server, you can use the extension &#8220;.html&#8221; for static and &#8220;.htm&#8221; for non-static files.<br />
2. You can have any number of URL stubs before the &#8220;.html&#8221; extension and you can access all these stubs in the controller.</p>
<p><b>Cons:</b><br />
1. The URL needs an extra extension.<br />
2. Only one controller per extension.</p>
<p>Do let me know what you think about this or if there is any way to improve on this.</p>
<p>Related posts:<ol>
<li><a href='http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/' rel='bookmark' title='Codeigniter: Separating reads and writes for scaling MySQL'>Codeigniter: Separating reads and writes for scaling MySQL</a> <small>Generally websites average a ratio of 9:1 or more for...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/making-codeigniter-clean-urls-cleaner/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Dropbox&#8217;s Y Combinator Funding Application &#8211; Summer 07</title>
		<link>http://thinkapi.com/blog/dropbox-y-combinator-funding-application-summer-07/</link>
		<comments>http://thinkapi.com/blog/dropbox-y-combinator-funding-application-summer-07/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 03:56:44 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Business IT]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[Hacker News]]></category>
		<category><![CDATA[sequoia capital]]></category>
		<category><![CDATA[Startup]]></category>
		<category><![CDATA[Y Combinator]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=186</guid>
		<description><![CDATA[Dropbox is an online storage company that offers multi platform access as well as version control. While they received a funding of $1.5 million Sequoia Capital, their initial incubation and seed stage funding was through Y Combinator. Their application to &#8230; <a href="http://thinkapi.com/blog/dropbox-y-combinator-funding-application-summer-07/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="https://www.getdropbox.com/"><img class="alignright size-full wp-image-187" title="dropbox_logo_home" src="http://thinkapi.com/blog/wp-content/uploads/2009/09/dropbox_logo_home.png" alt="dropbox_logo_home" width="290" height="75" />Dropbox</a> is an online storage company that offers multi platform access as well as version control. While they received a funding of $1.5 million <a href="http://www.sequoiacap.com/">Sequoia Capital</a>, their initial incubation and seed stage funding was through <a href="http://ycombinator.com/">Y Combinator</a>.</p>
<p><span id="more-186"></span>Their <a href="http://dl.dropbox.com/u/27532820/app.html">application to Y Combinator during summer of 2007</a> is an excellent example and a model for companies looking for seed stage funding. The recent discussion of this on <a href="http://news.ycombinator.com/item?id=801503">Hacker News</a> explores and analyses this. The comment from pg (Paul Graham) being</p>
<blockquote><p><span><span style="color: #000000;">What happens when I read this:</span><span style="color: #000000;">File syncing. Superset of backups, which people will pay for. Good. Single founder. Bad. But at least he&#8217;s looking for more people. Went to MIT, 1600 SAT. Probably fairly smart. Wrote a poker bot. Now I&#8217;m starting to get interested; has the right attitude. Description of the software sounds plausible but generic. Maybe it&#8217;s good, but who can tell. But little sister uses it; that&#8217;s impressive. Scroll down to what he understands that competitors don&#8217;t get. Wow: very concise and unequivocal. I&#8217;m now basically sold. Scroll through the rest. No red flags. Did not make the usual joke single founders make when asked how long the founders have known one another. Good answer to what might go wrong. A-. (Would be an A with a cofounder.)</span></span></p>
<p><span><span style="color: #000000;">I went back and looked at this application in our system, and I did in fact give it an A-.</span></span><span style="color: #000000;"> An A- means &#8220;I want to interview.&#8221; An A means &#8220;I want to interview, even if Rtm and Trevor don&#8217;t.&#8221; I only gave 2 As in s2007. (We funded both those companies, and both did badly.)</span></p></blockquote>
<p><span style="color: #000000;">The description of the company in a few sentences is the best part.</span></p>
<blockquote><p>Dropbox synchronizes files across your/your team&#8217;s computers. It&#8217;s much better than uploading or email, because it&#8217;s automatic, integrated into Windows, and fits into the way you already work. There&#8217;s also a web interface, and the files are securely backed up to Amazon S3. Dropbox is kind of like taking the best elements of subversion, trac and rsync and making them &#8220;just work&#8221; for the average individual or team. Hackers have access to these tools, but normal people don&#8217;t.</p>
<p>There are lots of interesting possible features. One is syncing Google Docs/Spreadsheets (or other office web apps) to local .doc and .xls files for offline access, which would be strategically important as few web apps deal with the offline problem.</p></blockquote>
<p>Drew&#8217;s profile and his alternate ideas add stars to the application.</p>
<blockquote><p>One click screen sharing (already done pretty well by Glance); a wiki with version-controlled drawing canvases that let you draw diagrams or mock up UIs (Thinkature is kind of related, but this is more text with canvases interspersed than a shared whiteboard) to help teams get on the same page and spec things out better (we use Visio and Powerpoint at Bit9, which sucks)</p></blockquote>
<p>Overall, its great to have such quality document as a reference and example for startups aiming for the skies.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/dropbox-y-combinator-funding-application-summer-07/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interview of distinguished programmers</title>
		<link>http://thinkapi.com/blog/interview-of-distinguished-programmers/</link>
		<comments>http://thinkapi.com/blog/interview-of-distinguished-programmers/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 06:23:08 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=179</guid>
		<description><![CDATA[Jarosław Rzeszótko from Poland decided to interview distinguished programmers. Linus Torvalds &#8211; The Linux kernel author Dave Thomas &#8211; Author of the “Pragmmatic Programmer”, “Programming Ruby” and other great books about programming. One can read his mainly programming-related thoughts here. &#8230; <a href="http://thinkapi.com/blog/interview-of-distinguished-programmers/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stifflog.com/">Jarosław Rzeszótko</a> from Poland decided to <a title="Stiff asks, great programmers answer" href="http://www.stifflog.com/2006/10/16/stiff-asks-great-programmers-answer/">interview distinguished programmers.</a></p>
<blockquote><p><strong>Linus Torvalds</strong> &#8211; The <a href="http://www.linux.org/">Linux kernel</a> author</p>
<p><strong>Dave Thomas</strong> &#8211; Author of the “Pragmmatic Programmer”, “Programming Ruby” and other great books about programming. One can read his mainly programming-related thoughts <a href="http://blogs.pragprog.com/cgi-bin/pragdave.cgi">here</a>.</p>
<p><strong>David Heinemeier Hansson</strong> &#8211; Author of the <a href="http://www.rubyonrails.org/">Rails Framework</a> &#8211; the new hot web development framework. He has a weblog <a href="http://www.loudthinking.com/">here</a>.</p>
<p><strong>Steve Yegge</strong> &#8211; Probably the least known from guys here, but also made one of the most interestings answers, has a popular <a href="http://steve-yegge.blogspot.com/">weblog</a> about programming. He is also the author of a game called “Wyvern”.</p>
<p><strong>Peter Norvig</strong> &#8211; Research Director at Google, a well known Lisper, author of famous (in some circles at least) books about AI. <a href="http://www.norvig.com/">See his homepage.</a></p>
<p><strong>Guido Van Rossum</strong> &#8211; The <a href="http://www.python.org/">Python</a> language creator</p>
<p><strong>Bjarne Stroustrup</strong> &#8211; C++ creator, has a homepage <a href="http://www.research.att.com/%7Ebs/">here</a></p>
<p><strong>James Gosling</strong> &#8211; The <a href="http://java.sun.com/">Java</a> language creator</p>
<p><strong>Tim Bray</strong> &#8211; One of the XML and Atom specifications author and a <a href="http://www.tbray.org/ongoing/">blogger</a> too.</p></blockquote>
<p>An excellent read.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/interview-of-distinguished-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter: Separating reads and writes for scaling MySQL</title>
		<link>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/</link>
		<comments>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 09:41:12 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[database replication]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql replication]]></category>
		<category><![CDATA[replication]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=173</guid>
		<description><![CDATA[Generally websites average a ratio of 9:1 or more for reads:writes for their applications which makes MySQL replication as one of the ways to scale you web application. The simplest configuration is to separate reads and writes with all the &#8230; <a href="http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thinkapi.com/blog/making-codeigniter-clean-urls-cleaner/' rel='bookmark' title='Making Codeigniter clean URLs cleaner'>Making Codeigniter clean URLs cleaner</a> <small>Usually when working with codeigniter you come across the use...</small></li>
<li><a href='http://thinkapi.com/blog/how-to-skip-mysql-replication-counter/' rel='bookmark' title='How to skip MySQL replication counter'>How to skip MySQL replication counter</a> <small>There are such times when MySQL replication stops when you...</small></li>
<li><a href='http://thinkapi.com/blog/upgrading-to-mysql-51-ga-better-wait/' rel='bookmark' title='Upgrading to MySQL 5.1 GA? Better Wait'>Upgrading to MySQL 5.1 GA? Better Wait</a> <small>MySQL 5.1 General Availability has been released to the public....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Generally websites average a ratio of 9:1 or more for reads:writes for their applications which makes MySQL replication as one of the ways to scale you web application. The simplest configuration is to separate reads and writes with all the reads coming from the slave servers.<br />
<span id="more-173"></span><br />
<div id="attachment_174" class="wp-caption aligncenter" style="width: 440px"><a href="http://www.teonator.net/2008/10/23/mysql-replication/"><img class="size-full wp-image-174" title="MySQL Database replication" src="http://thinkapi.com/blog/wp-content/uploads/2009/08/db_replication.jpg" alt="MySQL Database replication" width="430" height="450" /></a><p class="wp-caption-text">MySQL Database replication</p></div></p>
<p>We can implement this in <a href="http://codeigniter.com/" target="_blank">codeigniter</a> using database groups.<br />
Below is a sample execution.</p>
<p>Create two active groups &#8211; one for read and one for write.</p>
<p>File: system/application/config/database.php</p>
<pre class="brush: php; title: ; notranslate">
$active_group = &quot;write&quot;;
$active_record = TRUE;

$db['read']['hostname'] = &quot;localhost&quot;;
$db['read']['username'] = &quot;root&quot;;
$db['read']['password'] = &quot;&quot;;
$db['read']['database'] = &quot;read_database_name&quot;;
$db['read']['dbdriver'] = &quot;mysql&quot;;
$db['read']['dbprefix'] = &quot;&quot;;
$db['read']['pconnect'] = TRUE;
$db['read']['db_debug'] = FALSE;
$db['read']['cache_on'] = FALSE;
$db['read']['cachedir'] = &quot;&quot;;
$db['read']['char_set'] = &quot;utf8&quot;;
$db['read']['dbcollat'] = &quot;utf8_general_ci&quot;;

$db['write']['hostname'] = &quot;localhost&quot;;
$db['write']['username'] = &quot;root&quot;;
$db['write']['password'] = &quot;&quot;;
$db['write']['database'] = &quot;write_database_name&quot;;
$db['write']['dbdriver'] = &quot;mysql&quot;;
$db['write']['dbprefix'] = &quot;&quot;;
$db['write']['pconnect'] = TRUE;
$db['write']['db_debug'] = FALSE;
$db['write']['cache_on'] = FALSE;
$db['write']['cachedir'] = &quot;&quot;;
$db['write']['char_set'] = &quot;utf8&quot;;
$db['write']['dbcollat'] = &quot;utf8_general_ci&quot;;
</pre>
<p>Create separate database connections to access read and write databases separately where needed (constructor is generally a good place for this).</p>
<pre class="brush: php; title: ; notranslate">
$read_db = $this-&gt;load-&gt;database('read', TRUE);
$write_db = $this-&gt;load-&gt;database('write', TRUE);
</pre>
<p>You can now go about running queries in the usual way.</p>
<pre class="brush: php; title: ; notranslate">
/* For reads */
$query = $read_db-&gt;get('table_name');

foreach ($query-&gt;result() as $row)
{
    echo $row-&gt;title;
}

/* For writes */
$data = array(
               'title' =&gt; $title,
               'name' =&gt; $name,
               'date' =&gt; $date
            );

$write_db-&gt;insert('mytable', $data);
</pre>
<p>In case you want to try this on an application you are already running, you can leave the &#8220;default&#8221; connection group intact and create only the &#8220;read&#8221; connection group. Use it where you think you are running read heavy queries.</p>
<p>Related posts:<ol>
<li><a href='http://thinkapi.com/blog/making-codeigniter-clean-urls-cleaner/' rel='bookmark' title='Making Codeigniter clean URLs cleaner'>Making Codeigniter clean URLs cleaner</a> <small>Usually when working with codeigniter you come across the use...</small></li>
<li><a href='http://thinkapi.com/blog/how-to-skip-mysql-replication-counter/' rel='bookmark' title='How to skip MySQL replication counter'>How to skip MySQL replication counter</a> <small>There are such times when MySQL replication stops when you...</small></li>
<li><a href='http://thinkapi.com/blog/upgrading-to-mysql-51-ga-better-wait/' rel='bookmark' title='Upgrading to MySQL 5.1 GA? Better Wait'>Upgrading to MySQL 5.1 GA? Better Wait</a> <small>MySQL 5.1 General Availability has been released to the public....</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/codeigniter-separating-reads-and-writes-for-scaling-mysql/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>PythonTurtle &#8211; Python learning environment for beginners and children</title>
		<link>http://thinkapi.com/blog/pythonturtle-python-learning-environment-for-beginners-and-children/</link>
		<comments>http://thinkapi.com/blog/pythonturtle-python-learning-environment-for-beginners-and-children/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 07:47:58 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Random Articles]]></category>
		<category><![CDATA[learning environment]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=162</guid>
		<description><![CDATA[PythonTurtle is a fun and interesting way to learn python for beginners and children. According to the website, PythonTurtle strives to provide the lowest-threshold way to learn Python. Students command an interactive Python shell (similar to the IDLE development environment) &#8230; <a href="http://thinkapi.com/blog/pythonturtle-python-learning-environment-for-beginners-and-children/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><a title="PythonTurtle" href="http://pythonturtle.com/" target="_blank">PythonTurtle</a> is a fun and interesting way to learn python for beginners and children.</p>
<p style="text-align: left;"><img class="size-full wp-image-163 aligncenter" title="screenshot" src="http://thinkapi.com/blog/wp-content/uploads/2009/08/screenshot.gif" alt="screenshot" width="465" height="472" /></p>
<p><a title="PythonTurtle" href="http://pythonturtle.com/" target="_blank"><br />
</a></p>
<p><span id="more-162"></span>According to the website,</p>
<blockquote><p>PythonTurtle strives to provide the lowest-threshold way to learn Python. Students command an interactive Python shell (similar to the IDLE development environment) and use Python functions to move a turtle displayed on the screen. An illustrated help screen introduces the student to the basics of Python programming while demonstrating how to move the turtle.</p></blockquote>
<p>Resources:<br />
<a href="http://github.com/cool-RR/PythonTurtle/tree/master" target="_blank">Source Code</a><br />
<a href="http://pythonturtle.com/">Get installer from home page</a></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/pythonturtle-python-learning-environment-for-beginners-and-children/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create your own UNIX clone Operating System</title>
		<link>http://thinkapi.com/blog/how-to-create-your-own-unix-clone-operating-system/</link>
		<comments>http://thinkapi.com/blog/how-to-create-your-own-unix-clone-operating-system/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 07:11:53 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Systems]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[haskell]]></category>
		<category><![CDATA[kernel development]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[os dev]]></category>
		<category><![CDATA[os development]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[unix clone]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=157</guid>
		<description><![CDATA[Working on operating systems can be a lot of fun while learning some of the most difficult concepts in programming. One needs to have a basic set of knowledge and skills such as Basics of programming: variables, references, data types, &#8230; <a href="http://thinkapi.com/blog/how-to-create-your-own-unix-clone-operating-system/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Working on operating systems can be a lot of fun while learning some of the most difficult concepts in programming. One needs to have a basic set of knowledge and skills such as</p>
<p><span id="more-157"></span></p>
<p><strong>Basics of programming:</strong> variables, references, data types, scope, pointers, error handling, iteration, core algorithms related to searching, sorting, and so on<br />
<strong>Basics of maths and statistics:</strong> hexadecimal, binary, boolean logic, probability and so on<br />
<strong>Assembly:</strong> Knowledge of a low level language is very essential and part of writing an OS<br />
<strong>Languages:</strong> While C, C++ are the most widely used, one can also go with <a href="http://common-lisp.net/project/movitz/movitz.html" target="_blank">java</a>, <a href="http://common-lisp.net/project/movitz/movitz.html" target="_blank">haskell</a>, <a href="http://common-lisp.net/project/movitz/movitz.html" target="_blank">lisp</a> etc.<br />
<strong>Linux / Unix:</strong> Experience on linux or UNIX based platforms is needed for using tools required for OS development<br />
<strong>Tools:</strong> Familiarity in working with compilers, assemblers, linkers and make utility</p>
<p>Getting started:<br />
<a href="http://aodfaq.wikispaces.com/" target="_blank">Alt OS Development FAQ</a><br />
<a href="http://wiki.osdev.org/Getting_Started" target="_blank">OS Dev getting started</a></p>
<p>Resources:<br />
<a href="http://www.jamesmolloy.co.uk/tutorial_html/index.html" target="_blank">JamesM&#8217;s kernel development tutorials</a><a href="http://wiki.osdev.org/" target="_blank"><br />
OS development wiki</a> and <a href="http://forum.osdev.org/" target="_blank">OS development forums</a><br />
<a href="http://www.osdever.net/tutorials.php?cat=0&amp;sort=1" target="_blank">Tutorials from osdever.net</a><strong><a class="uln" href="http://groups.google.co.uk/groups/dir?sel=usenet%3Dalt"></a><br />
</strong><a href="http://groups.google.co.uk/group/alt.os.development/topics" target="_blank">alt.os.development</a><strong><br />
</strong> <a href="http://www.intel.com/products/processor/manuals/index.htm" target="_blank">Intel<span class="regtitle">®</span> 64 and IA-32 Architectures Software Developer&#8217;s Manuals</a><br />
<a href="http://www.logix.cz/michal/doc/i386/" target="_blank">Intel 80386 Programmer&#8217;s Reference Manual</a><br />
<a href="http://www.nondot.org/sabre/os/articles" target="_blank">OSRC: The Operating System Resource Center</a><br />
<a href="http://www.informit.com/articles/article.aspx?p=26396" target="_blank">Implementing an Operating System &#8211; By Andrew S. Tanenbaum</a></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/how-to-create-your-own-unix-clone-operating-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google recursion easter egg</title>
		<link>http://thinkapi.com/blog/google-recursion-easter-egg/</link>
		<comments>http://thinkapi.com/blog/google-recursion-easter-egg/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 11:14:35 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Random Articles]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=154</guid>
		<description><![CDATA[Try googling for the word recursion and you get &#8220;Did you mean: recursion&#8220;. Ofcouse you spelled it right. Its just that google enginners have a sense of humour No related posts.
No related posts.]]></description>
			<content:encoded><![CDATA[<p><a title="Google Recusrion" href="http://www.google.com/search?q=recursion" target="_self">Try googling for the word recursion</a> and you get &#8220;<span style="color: #cc0000;">Did you mean: </span><a href="http://www.google.com/search?q=recursion&amp;spell=1"><strong><em>recursion</em></strong></a>&#8220;. Ofcouse you spelled it right. Its just that google enginners have a sense of humour <img src='http://thinkapi.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/google-recursion-easter-egg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rediff Business Solutions &#8211; Rediff Hosting Review</title>
		<link>http://thinkapi.com/blog/rediff-business-solutions-rediff-hosting-review/</link>
		<comments>http://thinkapi.com/blog/rediff-business-solutions-rediff-hosting-review/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 12:05:40 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Business IT]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[domain name registration]]></category>
		<category><![CDATA[domain registration]]></category>
		<category><![CDATA[rediff business solutions]]></category>
		<category><![CDATA[rediff domain registration]]></category>
		<category><![CDATA[rediff hosting]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=105</guid>
		<description><![CDATA[Rediff business solutions consists of domain registration, hosting and e-mail solutions. Rediff Domain Name Registration Below is a screenshot of the home page As you can notice, only the first tab is for managing you domains. Rest are just tabs &#8230; <a href="http://thinkapi.com/blog/rediff-business-solutions-rediff-hosting-review/">Continue reading <span class="meta-nav">&#8594;</span></a>
No related posts.]]></description>
			<content:encoded><![CDATA[<div id="attachment_106" class="wp-caption alignright" style="width: 364px"><img class="size-full wp-image-106" title="Rediff Business Solutions" src="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_logo.gif" alt="Rediff Business Solutions - Rediff Hosting" width="354" height="29" /><p class="wp-caption-text">Rediff Business Solutions - Rediff Hosting</p></div>
<p>Rediff business solutions consists of domain registration, hosting and e-mail solutions.</p>
<p><strong><span id="more-105"></span>Rediff Domain Name Registration</strong></p>
<p>Below is a screenshot of the home page</p>
<div id="attachment_107" class="wp-caption aligncenter" style="width: 560px"><a href="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_hosting_home.gif"><img class="size-full wp-image-107" title="Rediff Hosting Home Page" src="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_hosting_home.gif" alt="Rediff Hosting Home Page" width="550" height="387" /></a><p class="wp-caption-text">Rediff Domain Hosting Home Page</p></div>
<p>As you can notice, only the first tab is for managing you domains. Rest are just tabs to buy other rediff services. The following features are available in terms of actual domain management control panel.</p>
<p>1. Create/manage A records</p>
<p>2. Mail server mapping</p>
<p>3. Domain forwarding (CNAME)</p>
<p>4. URL redirection (still in beta)</p>
<p>5. Edit domain registry information</p>
<p>6. Name server mapping</p>
<p>Missing features that are normally provided by other registrars</p>
<p>1. Hidden Whois</p>
<p>2. <strong>Account transfer</strong></p>
<p>3. Parking page customization</p>
<p>4. Auth code information</p>
<p>5. Place to renew your domain name</p>
<p>All the above is totally manual and is possible only through e-mail (weeks) or phone (days). Kinda ironic for an internet company.</p>
<p>Another interesting point I noted is that there is no place to change your account information. Want to change your password? No way. Want to change your secret question? No way. No way to even view this information. The support guys tell you this feature(?) just does not exist. Any chance we can get this anytime soon? No. Ever? No.</p>
<p>This is the kind of support you can expect.</p>
<p>Say you decide to go through the documentation/Help page yourself. This is what you get.</p>
<p style="text-align: center;">
<div id="attachment_110" class="wp-caption aligncenter" style="width: 590px"><a href="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_support.png"><img class="size-full wp-image-110" title="Rediff Support Page" src="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_support.png" alt="Rediff Support Page" width="580" height="623" /></a><p class="wp-caption-text">Rediff Support Page</p></div>
<p style="text-align: left;">
<p style="text-align: left;">So all you get is this page where the what you are looking for is tucked away in the corner. All the questions that are listed here assumes you are technically incompetant and there is no advanced help available at all. Notice the absense of support/contact number in all of the pages.</p>
<p style="text-align: left;">There is some decent information available in the FAQ page. But it turns out to be a sandbox.</p>
<p style="text-align: center;">
<div id="attachment_111" class="wp-caption aligncenter" style="width: 590px"><a href="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_faq.png"><img class="size-full wp-image-111" title="rediff_faq" src="http://thinkapi.com/blog/wp-content/uploads/2009/07/rediff_faq.png" alt="Reddit FAQ page" width="580" height="266" /></a><p class="wp-caption-text">Reddit FAQ page</p></div>
<p style="text-align: left;">
<p style="text-align: left;">So there is effectively no way to go back to the home page. Ofcourse, you can change the URL yourself but I am not so sure if kind of users rediff gets will be able to handle that.</p>
<p style="text-align: left;">With regard to the actual working of these features, I tested it by creating a new A record. While other registrars I have used take a couple of minutes to reflect this, rediff showed me the status as &#8220;<em>pending</em>&#8221; for 30 minutes and the actual record was only created 8 hours later. -1 for speed.</p>
<p style="text-align: left;"><strong>Conclusion</strong>: Rediff domain service is overpriced, under featured, supportless, slow running only on its previous reputation. My recommendation is to go with <a title="Domainsite" href="http://domainsite.com" target="_self">domainsite.com</a> (its faster and simpler than <a href="http://godaddy.com">godaddy</a>).</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/rediff-business-solutions-rediff-hosting-review/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ajax Push Engine &#8211; Javascript framework to handle 100,000 concurrent users</title>
		<link>http://thinkapi.com/blog/ajax-push-engine-javascript-framework/</link>
		<comments>http://thinkapi.com/blog/ajax-push-engine-javascript-framework/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 08:51:49 +0000</pubDate>
		<dc:creator>Sukumar</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[APE]]></category>
		<category><![CDATA[http server]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[xhr]]></category>

		<guid isPermaLink="false">http://thinkapi.com/blog/?p=96</guid>
		<description><![CDATA[From their website, Ajax Push Engine (APE) is an OpenSource technology allowing to exchange data between thousands of users through a web browser, without reloading and without external plugins. It consists of an epoll-driven HTTP server written in C as &#8230; <a href="http://thinkapi.com/blog/ajax-push-engine-javascript-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>
Related posts:<ol>
<li><a href='http://thinkapi.com/blog/socialhistoryjs-find-out-what-your-users-are-thinking/' rel='bookmark' title='SocialHistory.js &#8211; Find out what your users are thinking'>SocialHistory.js &#8211; Find out what your users are thinking</a> <small>SocialHistory.js &#8211; a solution (problem?) to check where your users...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 300px"><a href="http://www.ape-project.org/"><img title="APE Project" src="http://lh6.ggpht.com/_f3EtWybcQP4/SjCzwWAohnI/AAAAAAAAA04/5GGNFhxAGNY/s800/ape_logo_l.png" alt="Ajax Push Engine" width="290" height="110" /></a><p class="wp-caption-text">Ajax Push Engine</p></div>
<p><span style="line-height: 19px;">From their <a title="Ajax Push Engine" href="http://www.ape-project.org/" target="_self">website</a>,<strong> Ajax Push Engine</strong> (APE) is an <strong>OpenSource</strong> technology allowing to <strong>exchange data</strong> between <strong>thousands of users</strong> through a web browser, without reloading and without external plugins.</span></p>
<p>It consists of an <strong>epoll-driven HTTP server</strong> written in C as its core with a javascript framework based on mootools for the frontend. APE supports multiple patterns such as comet, XHR, long polling, forever frame etc. because of the way its designed.</p>
<p><span id="more-96"></span>APE can be used for a wide variety of applications ranging from browser based chat to updating stock quotes in real time, some of which can be seen on the <a href="http://www.ape-project.org/en/demos/" target="_self">demo page</a>.</p>
<p>The really interesting aspect of all this is the claim that APE can handle 100,000 connections on the same server. It is also  cross browser compatible and uses all the lastest browser features and provides backward compatibility for older ones.</p>
<p><strong>Related Links</strong></p>
<p><a title="APE project" href="http://www.ape-project.org/" target="_self">Official website</a></p>
<p><a title="About APE" href="http://www.ape-project.org/en/about.html" target="_self">Read more about APE architecture</a></p>
<p><a href="http://www.ape-project.org/en/demos/" target="_self">Demos</a></p>
<p>Related posts:<ol>
<li><a href='http://thinkapi.com/blog/socialhistoryjs-find-out-what-your-users-are-thinking/' rel='bookmark' title='SocialHistory.js &#8211; Find out what your users are thinking'>SocialHistory.js &#8211; Find out what your users are thinking</a> <small>SocialHistory.js &#8211; a solution (problem?) to check where your users...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://thinkapi.com/blog/ajax-push-engine-javascript-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

