<?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: Relational Databases as an &#8220;implementaiton detail?&#8221;</title>
	<atom:link href="http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/feed/" rel="self" type="application/rss+xml" />
	<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/</link>
	<description>Thinking about programming in new ways</description>
	<lastBuildDate>Tue, 15 Mar 2011 02:30:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: hernan43</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95554</link>
		<dc:creator>hernan43</dc:creator>
		<pubDate>Thu, 04 Oct 2007 13:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95554</guid>
		<description>I think I see what you are talking about now. Thanks for the book reco I will check it out.</description>
		<content:encoded><![CDATA[<p>I think I see what you are talking about now. Thanks for the book reco I will check it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Ramm</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95551</link>
		<dc:creator>Mark Ramm</dc:creator>
		<pubDate>Thu, 04 Oct 2007 12:25:12 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95551</guid>
		<description>Hernan43, 

I think the main thing I&#039;m talking about is the ability to map objects to relations, not just tables. So in SQLALchemy (and many other ORM&#039;s) you could for example, do a join across three tables, and map an object to that result set. 

In active record you can use the results of a custom SQ L query, but you can&#039;t modify and save back the results.

There are other features that I expect in a &quot;full featured&quot; ORM, like having an &quot;identity map,&quot; following the &quot;unit of work&quot; pattern, playing nice with database features like multicolumn primary keys, foreign key constraints, etc.   

I know I just threw out a couple of terms you may be unfamiliar with, if so, there&#039;s a great book -- Patterns of Enterprise Application Archetecture -- by Martin Fowler, which explains a lot of the basic principles of database access.  And it&#039;s that book which coined the terms &quot;identity map,&quot; &quot;unit of work,&quot; and even &quot;active record.&quot; I highly recommend it.</description>
		<content:encoded><![CDATA[<p>Hernan43, </p>
<p>I think the main thing I&#8217;m talking about is the ability to map objects to relations, not just tables. So in SQLALchemy (and many other ORM&#8217;s) you could for example, do a join across three tables, and map an object to that result set. </p>
<p>In active record you can use the results of a custom SQ L query, but you can&#8217;t modify and save back the results.</p>
<p>There are other features that I expect in a &#8220;full featured&#8221; ORM, like having an &#8220;identity map,&#8221; following the &#8220;unit of work&#8221; pattern, playing nice with database features like multicolumn primary keys, foreign key constraints, etc.   </p>
<p>I know I just threw out a couple of terms you may be unfamiliar with, if so, there&#8217;s a great book &#8212; Patterns of Enterprise Application Archetecture &#8212; by Martin Fowler, which explains a lot of the basic principles of database access.  And it&#8217;s that book which coined the terms &#8220;identity map,&#8221; &#8220;unit of work,&#8221; and even &#8220;active record.&#8221; I highly recommend it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hernan43</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95477</link>
		<dc:creator>hernan43</dc:creator>
		<pubDate>Wed, 03 Oct 2007 20:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95477</guid>
		<description>I&#039;m definitely not a high end programmer by any means. But ActiveRecord does have support for writing custom SQL queries. It even has hooks to extend your models as such. 

But it is possible that I don&#039;t get your meaning. I don&#039;t really know the difference between what would be considered simple vs. full featured ORMs.</description>
		<content:encoded><![CDATA[<p>I&#8217;m definitely not a high end programmer by any means. But ActiveRecord does have support for writing custom SQL queries. It even has hooks to extend your models as such. </p>
<p>But it is possible that I don&#8217;t get your meaning. I don&#8217;t really know the difference between what would be considered simple vs. full featured ORMs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Danesh Uthuranga</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95321</link>
		<dc:creator>Danesh Uthuranga</dc:creator>
		<pubDate>Wed, 03 Oct 2007 03:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-95321</guid>
		<description>Yes nice</description>
		<content:encoded><![CDATA[<p>Yes nice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan LaCour</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94975</link>
		<dc:creator>Jonathan LaCour</dc:creator>
		<pubDate>Mon, 01 Oct 2007 01:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94975</guid>
		<description>Great post Mark!  I love the decision to use SQLAlchemy as the default database layer within TurboGears 2.0.  SQLAlchemy gives people every level of abstraction they could possibly want:

* Users who want to do everything by hand can just use SQLAlchemy&#039;s connection pool and configuration, and issue straight hand-written SQL against the connection.  This offers a much cleaner and easier to work with option than the straight DB-API.

* People who love SQL but want to be database independent, and want to avoid object-relational mapping can use SQLAlchemy&#039;s table objects and SQL generation API.

* There will of course be people who are interested in using the power of the SQLAlchemy ORM, who can leverage the great mapping capabilities of SQLAlchemy following the data mapper pattern for maximum flexibility.

* People who want something a little bit simpler than SQLAlchemy&#039;s ORM and who prefer the active record pattern can utilize Elixir with minimal switches flipped in their project, giving them a cleaner API, and they won&#039;t sacrifice the great ability to drop down to SQLAlchemy&#039;s table objects or custom mappers when needed.

Its the best of all worlds, and will make TurboGears be able to not make the database layer just an implementation detail, but allow users to harness the raw power of their relational database of choice.

Keep it up, Mark!</description>
		<content:encoded><![CDATA[<p>Great post Mark!  I love the decision to use SQLAlchemy as the default database layer within TurboGears 2.0.  SQLAlchemy gives people every level of abstraction they could possibly want:</p>
<p>* Users who want to do everything by hand can just use SQLAlchemy&#8217;s connection pool and configuration, and issue straight hand-written SQL against the connection.  This offers a much cleaner and easier to work with option than the straight DB-API.</p>
<p>* People who love SQL but want to be database independent, and want to avoid object-relational mapping can use SQLAlchemy&#8217;s table objects and SQL generation API.</p>
<p>* There will of course be people who are interested in using the power of the SQLAlchemy ORM, who can leverage the great mapping capabilities of SQLAlchemy following the data mapper pattern for maximum flexibility.</p>
<p>* People who want something a little bit simpler than SQLAlchemy&#8217;s ORM and who prefer the active record pattern can utilize Elixir with minimal switches flipped in their project, giving them a cleaner API, and they won&#8217;t sacrifice the great ability to drop down to SQLAlchemy&#8217;s table objects or custom mappers when needed.</p>
<p>Its the best of all worlds, and will make TurboGears be able to not make the database layer just an implementation detail, but allow users to harness the raw power of their relational database of choice.</p>
<p>Keep it up, Mark!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John M. Camara</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94938</link>
		<dc:creator>John M. Camara</dc:creator>
		<pubDate>Sun, 30 Sep 2007 19:21:22 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94938</guid>
		<description>If I was building with concrete and steel I would want my hammers.  How would you put up the forms, chip concrete, show who&#039;s the boss to piece of steel by beating it into submission with big old sledge hammer, etc.  I can see using common hammers, framing, sledge, mason, jackhammers, hammer drills, chipping, etc. :)

Any way, when you need ad-hoc queries use a relational database.  If you need a relational database while programming with objects and you can live with the performance penalties you get with using an ORM go ahead and use an ORM.  They will make your life easier.  

Note that most applications don&#039;t need to worry about these performance issues so it is wiser to just use the ORMs so as to develop the code faster.  Those that are concerned about the performance issues probable shouldn&#039;t use a relation database to begin with.  At least this would be my advice for typical web applications.

When you use an ORM it is important to understand how the ORM works under the covers so that you don&#039;t do dumb things with it.  If you don&#039;t take the time to understand how they work you can easily build applications that have terrible performance issues and give the ORM a bad name.

Now what about the selection between a simple vs a full featured ORM.  I agree with Mark that you shouldn&#039;t use an ORM that tries to hide the database from you.  I know it is very tempting for most developers to just use a simple ORM as it takes very little time to get up and running with it.

But sooner or latter you will have performance issues or you will want to do something that the simple ORMs was not designed to handle.  You will have to fight with it and will have to learn the inner workings of it to understand why you are running into these performance issues.

If in the end, you&#039;re going to put all that effort to learn how to use a simple ORM you would be better served by taking the time to learn SQLAlchemy. It will not require that much more effort to learn SQLAlchemy than a simple ORM.  Although, you will have to put in a larger effort to get up and running with SA but the gains from the additional capabilities will more than make up for this extra effort.

With SA you will not find it necessary to fight with it.  At least no where near as often as you would with the simple ORMs.  Plus when ever you need to do something that the ORM layer was not designed to handle you have the option to drop to a layer below the ORM which is not possible with the simple ORMs.

What about Elixir (a declarative layer on top of SA)?  My advice is not to use it.  It will take less time to learn like the simple ORMs but sooner or latter you will have to learn more about SA and very likely the same amount of information as would be required had you just used straight SA&#039;s ORM.  

So in the end you will learn more and the only gain will be that you can save yourself a little typing.  To me it just doesn&#039;t seam worth the extra effort.  Of course if you do use Elixir you can still drop to the lower SA layers as necessary.</description>
		<content:encoded><![CDATA[<p>If I was building with concrete and steel I would want my hammers.  How would you put up the forms, chip concrete, show who&#8217;s the boss to piece of steel by beating it into submission with big old sledge hammer, etc.  I can see using common hammers, framing, sledge, mason, jackhammers, hammer drills, chipping, etc. :)</p>
<p>Any way, when you need ad-hoc queries use a relational database.  If you need a relational database while programming with objects and you can live with the performance penalties you get with using an ORM go ahead and use an ORM.  They will make your life easier.  </p>
<p>Note that most applications don&#8217;t need to worry about these performance issues so it is wiser to just use the ORMs so as to develop the code faster.  Those that are concerned about the performance issues probable shouldn&#8217;t use a relation database to begin with.  At least this would be my advice for typical web applications.</p>
<p>When you use an ORM it is important to understand how the ORM works under the covers so that you don&#8217;t do dumb things with it.  If you don&#8217;t take the time to understand how they work you can easily build applications that have terrible performance issues and give the ORM a bad name.</p>
<p>Now what about the selection between a simple vs a full featured ORM.  I agree with Mark that you shouldn&#8217;t use an ORM that tries to hide the database from you.  I know it is very tempting for most developers to just use a simple ORM as it takes very little time to get up and running with it.</p>
<p>But sooner or latter you will have performance issues or you will want to do something that the simple ORMs was not designed to handle.  You will have to fight with it and will have to learn the inner workings of it to understand why you are running into these performance issues.</p>
<p>If in the end, you&#8217;re going to put all that effort to learn how to use a simple ORM you would be better served by taking the time to learn SQLAlchemy. It will not require that much more effort to learn SQLAlchemy than a simple ORM.  Although, you will have to put in a larger effort to get up and running with SA but the gains from the additional capabilities will more than make up for this extra effort.</p>
<p>With SA you will not find it necessary to fight with it.  At least no where near as often as you would with the simple ORMs.  Plus when ever you need to do something that the ORM layer was not designed to handle you have the option to drop to a layer below the ORM which is not possible with the simple ORMs.</p>
<p>What about Elixir (a declarative layer on top of SA)?  My advice is not to use it.  It will take less time to learn like the simple ORMs but sooner or latter you will have to learn more about SA and very likely the same amount of information as would be required had you just used straight SA&#8217;s ORM.  </p>
<p>So in the end you will learn more and the only gain will be that you can save yourself a little typing.  To me it just doesn&#8217;t seam worth the extra effort.  Of course if you do use Elixir you can still drop to the lower SA layers as necessary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Ramm</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94923</link>
		<dc:creator>Mark Ramm</dc:creator>
		<pubDate>Sun, 30 Sep 2007 16:07:51 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94923</guid>
		<description>John, 

You have a good point.  There&#039;s plenty of room for non-relational data storage, from plain text files to ZODB.  

My point is not that you should always use relational data storage. In fact, that would be absurd! I don&#039;t want to store my python source code in a relational database, I want plain text.   

Instead, my point is that if you need the ability to do post-hoc queries you need the &quot;relational&quot; part of relational data storage, and you shouldn&#039;t use an ORM that hides that from you.

If on the other hand you just want to persist some objects to disk can live with a slightly simplified data query syntax, ZODB is going to make your life a lot easier than ActiveRecord would.   

To stretch the original analogy a bit, if you&#039;re building with concrete and steel, you may not need a hammer.   But I definitely wouldn&#039;t want to build a wooden tree house without one.</description>
		<content:encoded><![CDATA[<p>John, </p>
<p>You have a good point.  There&#8217;s plenty of room for non-relational data storage, from plain text files to ZODB.  </p>
<p>My point is not that you should always use relational data storage. In fact, that would be absurd! I don&#8217;t want to store my python source code in a relational database, I want plain text.   </p>
<p>Instead, my point is that if you need the ability to do post-hoc queries you need the &#8220;relational&#8221; part of relational data storage, and you shouldn&#8217;t use an ORM that hides that from you.</p>
<p>If on the other hand you just want to persist some objects to disk can live with a slightly simplified data query syntax, ZODB is going to make your life a lot easier than ActiveRecord would.   </p>
<p>To stretch the original analogy a bit, if you&#8217;re building with concrete and steel, you may not need a hammer.   But I definitely wouldn&#8217;t want to build a wooden tree house without one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John M. Camara</title>
		<link>http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94922</link>
		<dc:creator>John M. Camara</dc:creator>
		<pubDate>Sun, 30 Sep 2007 15:53:54 +0000</pubDate>
		<guid isPermaLink="false">http://compoundthinking.com/blog/index.php/2007/09/29/relational-databases-as-an-implementaiton-detail/#comment-94922</guid>
		<description>To make your case for TurboGears&#039; migration to SQLAlchemy you are making points on the following 2 issues.

- relational vs non-relational databases
- simple vs full featured ORMs

You should just concentrate on the simple vs full featured ORM issue as the choice of database type is a separate issue.  After all ORMs map to relational databases.

On the relational vs non-relational databases issue.

There are many types of hammers and choosing the ideal one for a particular job can make a world of difference in getting a task done.  Would you use a 10lb sledge hammer to drive a tack into a will?  I don&#039;t think so, as you will likely smash your hand holding the tack.

So what kind of hammer is a relational database?  Is it a common hammer.  What about BerkeleyDB?  A nail gun as its faster and not as flexible as a common hammer.  What about ZODB...

Seriously, there are many types of data stores and they are all tools.  The one who better knows the pros and cons of each tool can make wiser decisions on their use and will likely get the job done more efficiently.  So don&#039;t get fooled into believing that relational databases can solve all your problems and in a better way than other tools as in many cases they are the wrong tool to use.  

I prefer to &quot;work smarter not harder&quot; so I make sure my tool belt is full of tools.</description>
		<content:encoded><![CDATA[<p>To make your case for TurboGears&#8217; migration to SQLAlchemy you are making points on the following 2 issues.</p>
<p>- relational vs non-relational databases<br />
- simple vs full featured ORMs</p>
<p>You should just concentrate on the simple vs full featured ORM issue as the choice of database type is a separate issue.  After all ORMs map to relational databases.</p>
<p>On the relational vs non-relational databases issue.</p>
<p>There are many types of hammers and choosing the ideal one for a particular job can make a world of difference in getting a task done.  Would you use a 10lb sledge hammer to drive a tack into a will?  I don&#8217;t think so, as you will likely smash your hand holding the tack.</p>
<p>So what kind of hammer is a relational database?  Is it a common hammer.  What about BerkeleyDB?  A nail gun as its faster and not as flexible as a common hammer.  What about ZODB&#8230;</p>
<p>Seriously, there are many types of data stores and they are all tools.  The one who better knows the pros and cons of each tool can make wiser decisions on their use and will likely get the job done more efficiently.  So don&#8217;t get fooled into believing that relational databases can solve all your problems and in a better way than other tools as in many cases they are the wrong tool to use.  </p>
<p>I prefer to &#8220;work smarter not harder&#8221; so I make sure my tool belt is full of tools.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

