<?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>Omnia Mutantur &#187; hsql</title>
	<atom:link href="http://ricardo.strangevistas.net/tag/hsql/feed" rel="self" type="application/rss+xml" />
	<link>http://ricardo.strangevistas.net</link>
	<description>"No. Not even in the face of Armaggedon. Never compromise."</description>
	<lastBuildDate>Thu, 02 Apr 2009 17:03:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Grails and HSQL vs H2 vs Derby</title>
		<link>http://ricardo.strangevistas.net/grails-and-hsql-vs-h2-vs-derby.html</link>
		<comments>http://ricardo.strangevistas.net/grails-and-hsql-vs-h2-vs-derby.html#comments</comments>
		<pubDate>Wed, 01 Aug 2007 18:24:19 +0000</pubDate>
		<dc:creator>Ricardo</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[h2]]></category>
		<category><![CDATA[hsql]]></category>

		<guid isPermaLink="false">http://ricardo.strangevistas.net/grails-and-hsql-vs-h2-vs-derby.html</guid>
		<description><![CDATA[I&#8217;ve been building a personal project for a couple months now using Groovy on Grails. Through all this time we&#8217;ve been working with in-memory HSQL databases, but now that we&#8217;re ready to do a test release I began testing embedded Java databases to pick which one we would use.
My first candidate was Apache Derby, based [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been building a personal project for a couple months now using <a href="http://www.grails.org/" title="Grails - Home">Groovy on Grails</a>. Through all this time we&#8217;ve been working with <a href="http://hsqldb.org/" title="HSQLDB">in-memory HSQL databases</a>, but now that we&#8217;re ready to do a test release I began testing embedded Java databases to pick which one we would use.</p>
<p>My first candidate was <a href="http://db.apache.org/derby/papers/DerbyTut/install_software.html" title="Step 1: Install Software">Apache Derby</a>, based on some good performance reports I&#8217;ve read.  Unfortunately, I immediately ran into a problem, where objects weren&#8217;t being committed right away.  I would execute something like:</p>
<p><code><br />
new Animal(name:"Misingo").save()<br />
def misingo = Animal.findByName("Misingo")<br />
</code></p>
<p>And while the <em>save</em> call would succeed, the <em>findByName</em> function would fail.  I began digging through Google trying to find a work around, but the voice of reason in my head told me that if I was having to look for fixes for trivial tasks, I shouldn&#8217;t rely on it for anything major.</p>
<p>Dropping back to considering HSQL with file-based tables, I started researching HSQL performance and ran into a <a href="http://icoloma.blogspot.com/2007/01/hsqldb-vs-derby.html" title="The 90th percentile: Hsqldb vs Derby">HSQL vs Derby</a>, where a history of Derby bugs is mentioned and several benchmarks are pointed to.  This same article brought the very promising <a href="http://www.h2database.com/html/frame.html" title="H2 Database Engine">H2 Database</a> to my attention, which comes with some pretty impressive benchmarks.</p>
<p>I downloaded it and attempted to get H2 working with Grails 0.5.6, and got an easy enough to fix error:</p>
<blockquote><p>
    Could not determine Hibernate dialect for database name [H2]
</p></blockquote>
<p>In order for it to be recognized, you&#8217;ll have to create a file <em>hibernate/hibernate-dialects.properties</em> containing the following string:</p>
<p><code><br />
    H2Dialect=H2<br />
</code></p>
<p>This got H2 running and working perfectly for my development tests, but it failed when attempting to use production:</p>
<blockquote><p>
could not get database metadata<br />
org.h2.jdbc.JdbcSQLException: Table SYSTEM_SEQUENCES not found [42S02-55]
</p></blockquote>
<p>Google searching for &#8220;H2 SYSTEM_SEQUENCES&#8221; yielded only 3 pages, two of them in Japanese. <em>Not promising</em>.    Some testing determined that if the data source&#8217;s dbCreate property is set to either <em>create</em> or <em>create-drop</em> everything went smoothly, but it failed when set to <em>update</em>.</p>
<p>I went back to the H2 site, and found the following on the FAQ:</p>
<blockquote><p>
    Is it Reliable?</p>
<p>    That is not easy to say. It is still a quite new product. A lot of tests have been written, and the code coverage of these tests is very high. Randomized stress tests are run regularly. But as this is a relatively new product, there are probably some problems that have not yet been found. Areas that are not 100% tested:</p>
<ul>
<li><strong>Platforms other than Windows XP and the Sun JVM 1.4 and 1.5</strong></li>
<li>Data types BLOB, CLOB, VARCHAR_IGNORECASE, OTHER</li>
<li>Cluster mode, 2-Phase Commit, Savepoints</li>
<li>Server mode (well tested, but not as well as Embedded mode)</li>
<li>Multi-Threading and using multiple connections</li>
<li>Updatable result sets</li>
<li>Referential integrity and check constraints, Triggers</li>
<li><strong>ALTER TABLE statements</strong>, Views, Linked Tables, Schema, UNION</li>
</ul>
<p>    [...]
</p></blockquote>
<p>Evidently H2 is not ready for prime time &#8211; at least for my purposes &#8211; but it was refreshing to see the developer be upfront about it.  I&#8217;ll wait before using it in production, but my hat&#8217;s off to Mr. Thomas Mueller &#8211; the creator &#8211; for his work on creating his own DBMS from scratch (again, he was one of the original creators of the Hypersonic SQL Project, on which HSQLDB is based).</p>
<p>So where does this leave me? Back with HSQLDB.  Its performance is good, it&#8217;s stable and provides everything I need.  I guess I must be getting old if I&#8217;m deciding based on stability and ease, not on <em>shininess</em>, but sanity has prevailed.</p>
<p>And after all, I did give <em>shiny new thing</em> a fair shot.</p>
<p><small><br />
Bonus content:</p>
<ul>
<li><a href="http://www.michaelyuan.com/blog/2007/03/28/are-rails-and-grails-scalable/" title="Are Rails and Grails Scalable?">Grails scalability vs. Rails</a></li>
<li>An <a href="http://www.infoq.com/news/h2-released" title="InfoQ:<br />
    H2 1.0 Database by Hypersonic Creator is Out">article on H2&#8217;s release</a>, including some notes by the database&#8217;s creator.</li>
</ul>
<p></small></p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://ricardo.strangevistas.net/grails-and-hsql-vs-h2-vs-derby.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.127 seconds -->

