<?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>occasionally useful &#187; just for fun</title>
	<atom:link href="http://blog.maxaller.name/category/just-for-fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.maxaller.name</link>
	<description>ruby, ubuntu, etc</description>
	<lastBuildDate>Sun, 11 Jul 2010 07:01:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Banks and OAuth support</title>
		<link>http://blog.maxaller.name/2009/08/banks-and-oauth-support/</link>
		<comments>http://blog.maxaller.name/2009/08/banks-and-oauth-support/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 03:16:00 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=170</guid>
		<description><![CDATA[For fun, I decided to ping all of my financial companies (Bank Of America, CapitalOne, Chase, EmigrantDirect, INGDirect, Vanguard) about their plans for OAuth support.  I don't know how many of you use the wonderful service known as Mint, but I like it a lot.  Unfortunately, a part of me died when I [...]]]></description>
			<content:encoded><![CDATA[<p>For fun, I decided to ping all of my financial companies (Bank Of America, CapitalOne, Chase, EmigrantDirect, INGDirect, Vanguard) about their plans for OAuth support.  I don't know how many of you use the wonderful service known as <a href="http://www.mint.com">Mint</a>, but I like it a lot.  Unfortunately, a part of me died when I gave them my username/password for my banking sites.  And INGDirect is secure enough that Mint can't even interface with them!  Sorta cool.</p>
<p>Anyway, here's what the institutions said:<br />
<span id="more-170"></span></p>
<table border="0">
<tbody>
<tr>
<th>Company</th>
<th>Response</th>
</tr>
<tr>
<td>Bank Of America</td>
<td>
<p>Thank you for your suggestions regarding Online Banking. We value your opinion. The information you provided us will be forwarded to the appropriate department for ongoing evaluations of Online Banking.</p>
</td>
</tr>
<tr>
<td>CapitalOne</td>
<td>
<p>Thanks for your message.</p>
</td>
</tr>
<tr>
<td>Chase</td>
<td>
<p>In response to your inquiry, I will forward your suggestion to our development team for further consideration.</p>
</td>
</tr>
<tr>
<td>EmigrantDirect</td>
<td>
<p>Thank you for your feedback. We will certainly share your comments with the appropriate people within the organization.</p>
</td>
</tr>
<tr>
<td>INGDirect</td>
<td>
<p>We appreciate your feedback! Your suggestion will be forwarded to the appropriate area for review.</p>
</td>
</tr>
<tr>
<td>Vanguard</td>
<td>
<p>Thank you for your recent feedback concerning the OAuth protocol.  At this time, we do not have any immediate plans to support OAuth.</p>
<p>Your thoughts have been forwarded to the appropriate area for review. We are constantly accepting ideas for improvement on our site, and it's often through recommendations such as yours that enhancements are made.</p>
</td>
</tr>
</tbody>
</table>
<p>Originally this was going to be a more exciting post...but I guess I was too optimistic <img src='http://blog.maxaller.name/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>On the bright side, it makes me happy to be a customer of Vanguard's, now.  Their response was the only one that wasn't simply "thanks, we'll forward that to the appropriate party".  Even though their answer was pretty much "no", it came back quickly and concisely -- it took only like two hours turnaround, whereas most of the others took 2-3 days.</p>
<p>Also, Bank of America/CapitalOne/Chase sort of piss me off in that they *require* you to use their crappy internal messaging system, even for interacting with the company in as mundane a way as this.  Not only that, but I wasn't even notified when they'd replied.  Am I really supposed to sign into my bank website every day to check for messages?</p>
<p>Does your bank plan on supporting OAuth?  Let's raise the awareness a bit so we can get even more cool online tools for managing finances!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/08/banks-and-oauth-support/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>XSLT is a giant pain</title>
		<link>http://blog.maxaller.name/2009/04/xslt-is-a-giant-pain/</link>
		<comments>http://blog.maxaller.name/2009/04/xslt-is-a-giant-pain/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:06:11 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[musing]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=136</guid>
		<description><![CDATA[Some of you may be aware that XML+XSLT 1.0 can be rendered directly by modern browsers (even IE6!), which led me to thinking that it may be a good idea to give it a try and see how good or bad it was.

The process: for a given page (say, a search page), pull the data [...]]]></description>
			<content:encoded><![CDATA[<p>Some of you may be aware that XML+XSLT 1.0 can be rendered directly by modern browsers (even IE6!), which led me to thinking that it may be a good idea to give it a try and see how good or bad it was.</p>
<p><span id="more-136"></span></p>
<p>The process: for a given page (say, a search page), pull the data out of the database that you need in the controller and then output all the raw data as XML needed to generate the page in the template.  For a search page this would be the search results, the user's name (if signed in), etc.  Then you have your XSLT stylesheets.  Since this is all client-side, each one you have generates a request.  If you have one stylesheet that renders the initial page, and that stylesheet requires 4 other stylesheets...well, you have 5 requests right there just to display the page.</p>
<p>These other stylesheets <em>should </em>be mostly static, I'd hope.  In my mockup I didn't have to make any of them dynamic, but then I wasn't trying to do anything super advanced.  Anyway, Thin is smart enough to send 304s for the unmodified XSLTs, so at least that's good...</p>
<p>Other notes: one <em>can </em>do server-side rendering, but that's not the point of this exercise -- I want to do pure non-Javascript client-side rendering.  Unfortunately this also rules out XSLT 2.0, which was only finalized in January 2007 and would probably ease some of the pain.</p>
<p>Anyway, time for Code!</p>
<h1>Code</h1>
<h2>Adding HTML elements based on data</h2>
<p>...is a pain.  See <a href="http://pastie.org/451499" target="_blank">here</a> for my solution of preserving dropdown selections after a search (i.e. you search in a particular category and that category shows up in the dropdown on the end page).  Grotesquely verbose?  Why, yes it is!  I don't think there's a better way, either -- it would be acceptable to have a function that outputted XHTML instead of a template, but I think that's that's a 2.0-feature only.</p>
<h2>Changing values based on data</h2>
<p>This one isn't <a href="http://pastie.org/451607" target="_blank">quite so bad</a>, actually.  As with the previous example, though, you'll notice that you can't pull data in from the query parameters -- it has to be pulled in from the XML.  The original request has access to the query parameters, immediate requests <em>could </em>have access to the query parameters (since the original request url is passed in to immediate requests as the referrer), but non-immediate requests couldn't have any access to the query parameters at all whatsoever.</p>
<p>So what does this mean?  <em>All </em>data needs to be in the XML.  Not just product search results and personalization data, but also what the search query was, what the category was, what the sort order was, etc. if you plan on displaying any of that information.  Ugh!</p>
<h2>Preserving query parameters in links</h2>
<p>Guess what, more fun!  Check <a href="http://pastie.org/451619" target="_blank">this</a> out.  This is for pagination of search results -- all parameters needs to be preserved except for the page, which obviously changes.  Since this time the data needs to be stored in the attribute of another tag, we have to capture the template call into a variable first.  Cool, huh?</p>
<p>If anyone knows of a better way to do any of this with XSLT 1.0, please do let me know.  I am quite the novice and am just posting my discoveries thus far.  No guarantees of completeness.</p>
<h1>Other issues</h1>
<h2>Javascript/jQuery</h2>
<p>I was trying to figure out how to pull data from the original XML sheet via JavaScript, but it seems that JavaScript only has access to the rendered XHTML.  I could do an AJAX call to re-fetch the XML sheet and operate on that, but that seems silly to me.  I've tried looking for a cross-browser non-plugin solution but I don't think jQuery offers anything in this way.</p>
<h1>Discussion</h1>
<p>In regular HTML, you have HTML, CSS, and JS -- typically referred to as Structure, Display, and Behavior.  But really, HTML is typically structure and data combined, plus elements of display.  XML+XSLT is nice in theory because it explicitly breaks up structure/display and data.  But how much does that really buy you?  On modern MVC-style web frameworks, the controller passes data to the view/template so that the data can be rendered.  But with XML-XSLT the controller renders XML so that the client can transform that XML using the XSLTs you provide.  What's the point of emitting XML when you could just emit XHTML?  Frankly, data and structure don't *need* to be separated -- if you want just the data, then you need to set up a web service.  Frameworks like Ruby on Rails make this trivial.</p>
<p>So I guess the main benefit of separating data and structure the way XML and XSLT does is it means for the same XML, you can have different sets of XSLTs.  But wait...actually, you can't.  You embed the references for stylesheets for the XML file IN the XML file itself, i.e. the XML file says use this XSLT to render me.  So...if you want to switch XSLTs, you have to modify the XML file, which means you have to make the XML file content dynamically generated, which means you might as well use a fully-featured templating language on the server side.</p>
<h1>Conclusion</h1>
<p>XML+XSLT may have its uses, but general web applications is not one of them...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/04/xslt-is-a-giant-pain/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nifty easy screencast software</title>
		<link>http://blog.maxaller.name/2009/03/nifty-easy-screencast-software/</link>
		<comments>http://blog.maxaller.name/2009/03/nifty-easy-screencast-software/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 20:16:11 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://blog.maxaller.name/?p=77</guid>
		<description><![CDATA[Not necessarily the easiest or the best, but it certainly looks cool and could very much have a niche to call its own.  It's called uTIPu.
Check it out.  Someday I'll create a screencast for something useful.
]]></description>
			<content:encoded><![CDATA[<p>Not necessarily the easiest or the best, but it certainly looks cool and could very much have a niche to call its own.  It's called <a href="http://www.utipu.com/">uTIPu</a>.</p>
<p>Check it out.  Someday I'll create a screencast for something useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/03/nifty-easy-screencast-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Reader Commenter script</title>
		<link>http://blog.maxaller.name/2009/01/google-reader-commenter-script/</link>
		<comments>http://blog.maxaller.name/2009/01/google-reader-commenter-script/#comments</comments>
		<pubDate>Thu, 01 Jan 2009 23:55:18 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=52</guid>
		<description><![CDATA[At Esther's request, I wrote a script that lets you comment on blogs that are in your Google Reader list.  Right now it only works on Blogger and WordPress blogs, but that's actually a fair number of blogs.
Requirements: Firefox, Greasemonkey Plugin
Check it out here: GitHub repository
Here's a picture: Picture
]]></description>
			<content:encoded><![CDATA[<p>At Esther's request, I wrote a script that lets you comment on blogs that are in your Google Reader list.  Right now it only works on Blogger and WordPress blogs, but that's actually a fair number of blogs.</p>
<p>Requirements: Firefox, Greasemonkey Plugin</p>
<p>Check it out here: <a href="http://github.com/nanodeath/google-reader-commenter-script/tree/master">GitHub repository</a></p>
<p>Here's a picture: <a href="http://github.com/nanodeath/google-reader-commenter-script/raw/master/doc/Google%20Reader%20Commenter.png" target="_blank">Picture</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2009/01/google-reader-commenter-script/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>DEPRECATED: Announcing: jQuery optimization races</title>
		<link>http://blog.maxaller.name/2008/12/announcing-jquery-optimization-races/</link>
		<comments>http://blog.maxaller.name/2008/12/announcing-jquery-optimization-races/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 02:07:48 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[just for fun]]></category>
		<category><![CDATA[web 2.0]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=49</guid>
		<description><![CDATA[Note...this site is down for now...
You don't have to understand it to see that it's at least a bit interesting, so check it out:
http://www.nutriscan.org/jquery_optimization/
It documents a bunch of different ways of doing similar things, and compares them in terms of performance.  How much are you really losing by using the jQuery convenience method?
]]></description>
			<content:encoded><![CDATA[<p>Note...this site is down for now...</p>
<p>You don't have to understand it to see that it's at least a bit interesting, so check it out:</p>
<p><a href="http://www.nutriscan.org/jquery_optimization/">http://www.nutriscan.org/jquery_optimization/</a></p>
<p>It documents a bunch of different ways of doing similar things, and compares them in terms of performance.  How much are you <em>really</em> losing by using the jQuery convenience method?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/12/announcing-jquery-optimization-races/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jquery_merb continued</title>
		<link>http://blog.maxaller.name/2008/11/jquery_merb-continued/</link>
		<comments>http://blog.maxaller.name/2008/11/jquery_merb-continued/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 19:00:29 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[just for fun]]></category>
		<category><![CDATA[merb]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=41</guid>
		<description><![CDATA[So...I think, for now, I'm done with jquery_merb.

And for once, that's a good thing, because by "done for now" I mean..."done" pending more ideas.  It's thoroughly documented and tested, and I think I might just set it aside for now until I find other features it needs to interact with Merb better.  Which [...]]]></description>
			<content:encoded><![CDATA[<p>So...I think, for now, I'm done with jquery_merb.</p>
<p><span id="more-41"></span></p>
<p>And for once, that's a good thing, because by "done for now" I mean..."done" pending more ideas.  It's thoroughly documented and tested, and I think I might just set it aside for now until I find other features it needs to interact with Merb better.  Which may be never.</p>
<p>On the bright side, Minirequest/Solitary Part came out of it and is now living in its own repository.  It's like half done, but doesn't have tests or much documentation.  Also I'd like it to work with partials, which it currently doesn't handle <em>at all</em>.  After that though, it's on to my next project...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/11/jquery_merb-continued/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>introducing&#8230;jquery_merb (sort of)</title>
		<link>http://blog.maxaller.name/2008/11/introducingjquery_merb-sort-of/</link>
		<comments>http://blog.maxaller.name/2008/11/introducingjquery_merb-sort-of/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 05:40:07 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[jquery]]></category>
		<category><![CDATA[just for fun]]></category>
		<category><![CDATA[merb]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=40</guid>
		<description><![CDATA[I love jQuery.  I love Merb.  I thought, so why not work on both?  I tried this previously from the merb side with the now gone merb_multi_js plugin, which I had made a substantial amount of progress on before I killed it.  It was designed to mimic rails and generate handy [...]]]></description>
			<content:encoded><![CDATA[<p>I love jQuery.  I love Merb.  I thought, so why not work on both?  I tried this previously from the merb side with the now gone merb_multi_js plugin, which I had made a substantial amount of progress on before I killed it.  It was designed to mimic rails and generate handy JavaScript for you not using Prototype.js, but whatever web framework you wanted (I of course had jQuery, Prototype.js, and I think YUI).  Alas, I realized that because of some of its design principles, it would never be performance-friendly.</p>
<p>Enter jquery_merb, or jquery.merb.js.</p>
<p><span id="more-40"></span></p>
<p>This library takes on a different role; rather than generating javascript for you (ew) it's meant to be a collection of helpers that assist your coding in interacting with your Merb server.  For instance, if you want to use AJAX to perform CRUD operations on a resource, instead of hacking together an ajax call you can say this:</p>
<pre><span class="c">$.merb.resource.read({resources: 'notes', id: 5, dataType: 'json'})
</span></pre>
<p>Neat huh?  The interface isn't <em>quite </em>as clean as it could be, but alas, that's because of the inescapable fact that resources have singular and plural forms which can't be resolved programmatically in JavaScript.</p>
<p>The thing I've been working on for the past couple days actually <em>does </em>dip into the merb side, but only just.  I think it would be cool to be able to easily reload a <strong>part</strong> (using AJAX) that you use in your view, without a lot of extra work from you (no special controller methods or templates, or even writing an ajax call).  This would mean something as simple as $("#my_part").merb_reload(); and the part would reload with, say, the most recent blog posts.  See <a href="http://github.com/nanodeath/jquery_merb/wikis/ideas" target="_blank">here</a> for more details.</p>
<p>So that's what I'm working on these days...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/11/introducingjquery_merb-sort-of/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Game ideas?</title>
		<link>http://blog.maxaller.name/2008/10/game-ideas/</link>
		<comments>http://blog.maxaller.name/2008/10/game-ideas/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 04:26:31 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[games]]></category>
		<category><![CDATA[idea]]></category>
		<category><![CDATA[just for fun]]></category>
		<category><![CDATA[musing]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=38</guid>
		<description><![CDATA[Well, another day, another quest for game ideas.  An online game would be fun to make, but my problem is always I think too damn big.  My last idea was a Utopia clone, and I got so far as to create a scripting language that compiled into Ruby, but I just never got [...]]]></description>
			<content:encoded><![CDATA[<p>Well, another day, another quest for game ideas.  An online game would be fun to make, but my problem is always I think too damn <em>big</em>.  My last idea was a <a href="http://games.swirve.com/UTOPIA/index.php" target="_blank">Utopia</a> clone, and I got so far as to create a scripting language that compiled into Ruby, but I just never got around to finishing it.  What would be nice is a game that's fun in its simplicity -- simple to play, simple to program, just something you spend half an hour or an hour on a day, tops.  There'd be a way to interact with other people easily; there'd be chat rooms and forums, and discernible "hot spots" where a lot of people were chatting or posting messages.  But the most important thing is core gameplay: unique, rewarding, and fun.  I'll get right on that...</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/10/game-ideas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merb tutorial resumed</title>
		<link>http://blog.maxaller.name/2008/09/merb-tutorial-resumed/</link>
		<comments>http://blog.maxaller.name/2008/09/merb-tutorial-resumed/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 23:11:59 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=37</guid>
		<description><![CDATA[It's been a retarded week at work (65 hours in 6 days) but things should be lightening up a bit from here on and so I might actually get home at a reasonable hour.  In any case, I'm working more on my catch-all merb guide tutorial thing and will be filling in the self-contained [...]]]></description>
			<content:encoded><![CDATA[<p>It's been a retarded week at work (65 hours in 6 days) but things should be lightening up a bit from here on and so I might actually get home at a reasonable hour.  In any case, I'm working more on my catch-all merb guide tutorial thing and will be filling in the self-contained sections, but decided I should put off the sample application until I write it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/09/merb-tutorial-resumed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CouchDB and logs&#8230;</title>
		<link>http://blog.maxaller.name/2008/08/couchdb-and-logs/</link>
		<comments>http://blog.maxaller.name/2008/08/couchdb-and-logs/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 22:20:50 +0000</pubDate>
		<dc:creator>Max</dc:creator>
				<category><![CDATA[just for fun]]></category>
		<category><![CDATA[couchdb]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[document-oriented database]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://giftswappo.com/wordpress/?p=35</guid>
		<description><![CDATA[I've taken it upon myself to do some log analysis at my work.  This involves taking a large volume of logs (multiple gigabytes) and somehow organizing them so that the data stored within them are readily available.  This is no small task.  At present, there are thousands of individually gzipped files, and [...]]]></description>
			<content:encoded><![CDATA[<p>I've taken it upon myself to do some log analysis at my work.  This involves taking a large volume of logs (multiple gigabytes) and somehow organizing them so that the data stored within them are readily available.  This is no small task.  At present, there are thousands of individually gzipped files, and the best way to find what you're looking for is to essentially 'zcat *.gz | grep -in "session=123"' to get what you want and is, frankly, absurd.  In some types of log files, you have 15 lines that all pertain to the same log record, with each line in the format KEY=monkeyfacevalue, and in others you have everything on the same line, with key/value pairs comma delimited.  Doesn't really matter, but there are key-value pairs in both case, and no two log records necessarily have the same set of keys.  This sounded like an opportunity to try out a new type of database...CouchDB.</p>
<p>But, in the end, I think CouchDB is not the best way to solve this problem...</p>
<p><span id="more-35"></span></p>
<p>CouchDB is what's called a <strong>document-oriented database</strong>.  This is as opposed to <strong>relational databases</strong>, like MySQL, PostreSQL, Oracle, even sqlite.  For convenience I'm going to abbreviate each as DOD and RD, respectively.</p>
<p>How they differ:</p>
<ol>
<li>DODs are schema-less.  This means there are no columns/fields to speak of with size constraints.  A "document" is a record in the database, which is essentially a hashmap (or associative array if you prefer) with a couple other little features (i.e. revisioning).</li>
<li>There are no "queries" in DODs (CouchDB, at least).  If you were curious about how something without rigid structure could be fast, this is how.  Instead of queries, you have "views", which are only slightly related to views in the RD sense.  There are two types of views -- permanent views and temporary views.  A view is the result of calling a user-defined function on every record in the database -- if the function evaluates to true, the record is included in the view.  Permanent views are stored in the form of design documents within the database itself.  Every time you add or modify a record, every view function is called on that record to (re)evaluate whether that record should be included in a particular view.  Temporary views are the basically the same, but not stored permanently in a design document -- they disappear after they're used.</li>
<li>Some other things, see <a href="http://en.wikipedia.org/wiki/CouchDB">Wikipedia</a> or their <a href="http://incubator.apache.org/couchdb/">official page</a>.</li>
</ol>
<p>So here's the problem.  You can't just say "Show all blog posts by user X", because that would require you pass a variable.  Not a big deal; you create a view that returns true if the blog post belongs to that user.  But still, you have to create a view for every single user if you want to be able to select all the blog posts by any particular user -- I'd imagine that could take up a lot of space, and CPU cycles.  Alternatively, you could have a view that just returned all blog posts, and then filter through those in your application.  Neither would be that good though, I feel, but I might be missing something.</p>
<p>Similarly, in a log file, you can't say "Give me all records with session ID Y" -- you'd need a view for that, and a temporary view would have to be generated on the fly, and the permanent view...well, you'd want a permanent view for every session ID, and there could be tens of thousands of those.  Plus every time you add a new record, you'd have to run the view functions for all those on it, and that could take a while.</p>
<p>On the bright side, CouchDB doesn't have any locks in it (helps that it was written in Erlang).  This means that no matter who or how many are reading or writing, nothing will ever get blocked.  Additionally, I guess you can seamlessly distribute the contents of the database across multiple servers and get redundancy pretty easily, but I haven't looked into that tooo much.  Also, CouchDB is technically Alpha, so all of the functionality hasn't actually been implemented yet, like interfacing with Apache Lucene (a full-text indexer search thing).</p>
<p>So CouchDB looks like it has a lot of potential, but I'm not exactly sure for what, unless you never have that many documents in the database or not that many different parameters you want to be searching on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.maxaller.name/2008/08/couchdb-and-logs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
