<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Thinking About Database Revision Control</title>
	<atom:link href="http://www.robsearles.com/2009/10/11/thinking-about-database-revision-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robsearles.com/2009/10/11/thinking-about-database-revision-control/</link>
	<description>Musing on the business of and development for "The Web"</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:08:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rob Searles</title>
		<link>http://www.robsearles.com/2009/10/11/thinking-about-database-revision-control/comment-page-1/#comment-48</link>
		<dc:creator>Rob Searles</dc:creator>
		<pubDate>Mon, 19 Oct 2009 14:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.robsearles.com/?p=180#comment-48</guid>
		<description>I think you&#039;re right - it is a lot better to get the structure of the database specified at the start. Unfortunately this isn&#039;t always possible, especially if your working on a project where your &quot;feeling your way&quot; in the start - either because you are using new techniques, or the brief is an evolving one.&lt;br&gt;&lt;br&gt;The full DB dump might be good if it is also accompanied by update scripts for both up and down. This way an existing system can just have their tables updated, but a new system can have a clean install. However, this still doesn&#039;t solve the problem of the 2 devs committing differing changes to the database - there will always be, as you say, a winner and a loser.&lt;br&gt;&lt;br&gt;The best solution is probably the non-tech solution! (Which pains me to say!) where one dev is the DBA and all changes can go through them. This could be coupled with an agile mentality of having daily meetings to discuss any structural changes needed the the database and why. &lt;br&gt;&lt;br&gt;Thanks for your thought provoking comment.</description>
		<content:encoded><![CDATA[<p>I think you&#39;re right &#8211; it is a lot better to get the structure of the database specified at the start. Unfortunately this isn&#39;t always possible, especially if your working on a project where your &#8220;feeling your way&#8221; in the start &#8211; either because you are using new techniques, or the brief is an evolving one.</p>
<p>The full DB dump might be good if it is also accompanied by update scripts for both up and down. This way an existing system can just have their tables updated, but a new system can have a clean install. However, this still doesn&#39;t solve the problem of the 2 devs committing differing changes to the database &#8211; there will always be, as you say, a winner and a loser.</p>
<p>The best solution is probably the non-tech solution! (Which pains me to say!) where one dev is the DBA and all changes can go through them. This could be coupled with an agile mentality of having daily meetings to discuss any structural changes needed the the database and why. </p>
<p>Thanks for your thought provoking comment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pete_bln</title>
		<link>http://www.robsearles.com/2009/10/11/thinking-about-database-revision-control/comment-page-1/#comment-46</link>
		<dc:creator>pete_bln</dc:creator>
		<pubDate>Sun, 18 Oct 2009 05:33:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.robsearles.com/?p=180#comment-46</guid>
		<description>I think the answer is 2 : It is actually a lot harder than you think ;-)&lt;br&gt;&lt;br&gt;Revision control systems are based on the premise that we&#039;re mostly dealing with text files, and when there&#039;s a conflict we can diff and merge.  Obviously this doesn&#039;t work with databases.&lt;br&gt;&lt;br&gt;One can keep a record of all changes as (an) SQL file(s), and when updating, import the latest changes.&lt;br&gt;&lt;br&gt;Problems are (apart from the possibility of forgetting to record a &lt;br&gt;statement) that:&lt;br&gt;&lt;br&gt; - The statements aren&#039;t easily automatically reversible when you need to do a revert.  That would take a sophisticated SQL parser (that would also be DB server specific)&lt;br&gt;&lt;br&gt;- Some transactions aren&#039;t simply reversible (DELETE, DROP etc)&lt;br&gt;&lt;br&gt;- It&#039;s little help when there&#039;s a conflict - i.e. two devs commit 2 very different changes to the database.   The accompanying code (at least at the model level) is also too tied to the underlying DB structure.&lt;br&gt;&lt;br&gt;One solution (though inelegant and wasteful) is to force (or better script) that just prior to each commit, a full DB dump is made.  When updating, the existing local DB is completely replaced by the dump.  Still doesn&#039;t help much with conflicts with mutually exclusive DB structure changes - there then would be a &quot;winner&quot; and a &quot;loser&quot;.&lt;br&gt;&lt;br&gt;Despite my fondness for things agile and extreme, I actually think it&#039;s often good in the long-term to have the core DB structure made concrete before starting coding.  It&#039;s always a major PITA when core tables need to change half-way through a project. (Extra tables aren&#039;t usually a problem)&lt;br&gt;&lt;br&gt;One non-technical solution is to have one dev designated as the DBA, and all changes to structure and required records would go atomically through them.</description>
		<content:encoded><![CDATA[<p>I think the answer is 2 : It is actually a lot harder than you think <img src='http://www.robsearles.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Revision control systems are based on the premise that we&#39;re mostly dealing with text files, and when there&#39;s a conflict we can diff and merge.  Obviously this doesn&#39;t work with databases.</p>
<p>One can keep a record of all changes as (an) SQL file(s), and when updating, import the latest changes.</p>
<p>Problems are (apart from the possibility of forgetting to record a <br />statement) that:</p>
<p> &#8211; The statements aren&#39;t easily automatically reversible when you need to do a revert.  That would take a sophisticated SQL parser (that would also be DB server specific)</p>
<p>- Some transactions aren&#39;t simply reversible (DELETE, DROP etc)</p>
<p>- It&#39;s little help when there&#39;s a conflict &#8211; i.e. two devs commit 2 very different changes to the database.   The accompanying code (at least at the model level) is also too tied to the underlying DB structure.</p>
<p>One solution (though inelegant and wasteful) is to force (or better script) that just prior to each commit, a full DB dump is made.  When updating, the existing local DB is completely replaced by the dump.  Still doesn&#39;t help much with conflicts with mutually exclusive DB structure changes &#8211; there then would be a &#8220;winner&#8221; and a &#8220;loser&#8221;.</p>
<p>Despite my fondness for things agile and extreme, I actually think it&#39;s often good in the long-term to have the core DB structure made concrete before starting coding.  It&#39;s always a major PITA when core tables need to change half-way through a project. (Extra tables aren&#39;t usually a problem)</p>
<p>One non-technical solution is to have one dev designated as the DBA, and all changes to structure and required records would go atomically through them.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

