<?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>Thought Clusters &#187; databases</title>
	<atom:link href="http://www.thoughtclusters.com/tag/databases/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thoughtclusters.com</link>
	<description>Software Development &#38; Management</description>
	<lastBuildDate>Tue, 10 Aug 2010 03:27:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Do The Basic Research</title>
		<link>http://www.thoughtclusters.com/2010/01/do-the-basic-research/</link>
		<comments>http://www.thoughtclusters.com/2010/01/do-the-basic-research/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 23:48:35 +0000</pubDate>
		<dc:creator>Krishna</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[normalization]]></category>

		<guid isPermaLink="false">http://www.thoughtclusters.com/?p=1204</guid>
		<description><![CDATA[I fail to comprehend how someone can write this (emphasis mine): Overdesign is also very common with databases. People get hung up on rules like &#8220;third normal form&#8221;. Sometimes when you over-normalize a database is [sic] makes it impossible to &#8230; <a href="http://www.thoughtclusters.com/2010/01/do-the-basic-research/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I fail to comprehend how <a href="http://www.codecapers.com/post/Software-Development-Dos-and-Donts.aspx">someone can write this</a> (emphasis mine):</p>
<blockquote><p>Overdesign is also very common with databases. <strong>People get hung up on rules like &#8220;third normal form&#8221;.</strong> Sometimes when you over-normalize a database is [<em>sic</em>] makes it impossible to query the data later on. If your application is going to require reports, sometimes its better to design the database with the reports in mind. In other words, let the reports dictate how the data is stored.</p></blockquote>
<p>This kind of advice is insane, ridiculous stuff. Take a minute and read what the <a href="http://en.wikipedia.org/wiki/Third_normal_form">third normal form</a> means. Not following the third normal form means essentially having duplicate data in different places in your database creating a serious nightmare in maintaining data integrity. What you gain in reporting, you will lose when you start writing code to ensure that data is consistent everywhere.</p>
<p>Normalizing a database does not make it &#8220;impossible&#8221; to query data. If you have many tables because of normalization, work is harder because you need multiple joins to do the trick. But if you know elementary SQL, you can get it done easily. On the other hand, if you haven&#8217;t normalized properly, you have very silly problems. For example, in the Wikipedia example, to find out how many players were born on the 1st of January, you have to write code that does not count the birthdays of multiple players twice. In a normalized database, it is an extremely simple query.</p>
<p>It is ironic that the author talks about &#8220;overdesign&#8221; while falling victim to premature optimization. First, understand what normalization is supposed to do and how it helps you. Learn SQL or use tools that can help you get your data out easily. Profile your application and find ways to improve performance. And only if everything fails, then go for denormalization. And that too, only after understanding its downsides and how to prevent them.</p>
<p>Read my <a href="http://www.thoughtclusters.com/2009/03/understand-normalization-before-denormalizing/">previous article</a> on the same subject.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtclusters.com/2010/01/do-the-basic-research/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Non-Reason for Using ORM</title>
		<link>http://www.thoughtclusters.com/2009/08/a-non-reason-for-using-orm/</link>
		<comments>http://www.thoughtclusters.com/2009/08/a-non-reason-for-using-orm/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 11:00:09 +0000</pubDate>
		<dc:creator>Krishna</dc:creator>
				<category><![CDATA[software development]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[ORM]]></category>

		<guid isPermaLink="false">http://www.thoughtclusters.com/?p=544</guid>
		<description><![CDATA[There are many good reasons for choosing an ORM tool instead of using stored procedures. But one reason has always struck me as rather silly. That is choosing an ORM so that you can easily switch databases in the future. &#8230; <a href="http://www.thoughtclusters.com/2009/08/a-non-reason-for-using-orm/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are many good reasons for choosing an ORM tool instead of using stored procedures. But one reason has always struck me as rather silly. That is choosing an ORM so that you can easily switch databases in the future. I am not disputing that using an ORM enables you more in changing databases, but I am questioning why you would want to base your project on such an assumption.</p>
<p>There are several problems with the idea that you would want to change databases in the future. One is that in a non-trivial application, your interaction with the database is not limited to running SQL queries against it. Most mainstream database servers have several features that enable you to gain better performance and scale your application better. And you would be well advised to use such performance tuning.</p>
<p>If you decide to switch to another database server, you will have to do similar activities in the new server. You would have to relearn how to do it in the new server, or hire resources who are knowledgeable in it. There is also the possibility that some data migration efforts may be required, even though tools do exist. It is not as simple as you may think and is more a distraction than a benefit to the project.</p>
<p>In terms of price and scalability, most database vendors also offer you an easy path upwards. You can run the lowest version on your desktop and it probably costs $0. And there would be a high-end version that scales to multiple machines and costs thousands of dollars. So the need to rewrite the software for another database server is reduced.</p>
<p>Now, I have seen instances where a rewrite from Oracle to mySQL (<em>for cost reasons</em>) or from Access to SQL Server (<em>for scalability</em>) or from some dead database vendor&#8217;s database to a database in the present market has been done. But these were projects where there was no ORM to begin with. If somebody started a project in recent times and then had to change their database server, I wonder what thinking they put into selecting the database in the first place.</p>
<p>Just as you would not choose your programming technology in a casual manner, it is important to put sufficient effort in choosing the right database server. Being cavalier about it and assuming you can easily shift database servers (<em>and would want to</em>) in the future is not the right way to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtclusters.com/2009/08/a-non-reason-for-using-orm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
