<?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: Storing Custom Fields in the Database</title>
	<atom:link href="http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/</link>
	<description>A blog about programming in .NET and Java</description>
	<pubDate>Sun, 05 Jul 2009 03:17:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Andrey V. Shtukaturov</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1174</link>
		<dc:creator>Andrey V. Shtukaturov</dc:creator>
		<pubDate>Mon, 04 Feb 2008 08:51:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1174</guid>
		<description>&lt;p&gt;there are also Flexfields "technology" under Oracle
http://www.oracle.com/technology/tech/blaf/specs/flexfields.html FlexFields&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>there are also Flexfields &#8220;technology&#8221; under Oracle
<a href="http://www.oracle.com/technology/tech/blaf/specs/flexfields.html" rel="nofollow">http://www.oracle.com/technology/tech/blaf/specs/flexfields.html</a> FlexFields</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Weekly linkdump #111 - cb - блог разработчиков</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1171</link>
		<dc:creator>Weekly linkdump #111 - cb - блог разработчиков</dc:creator>
		<pubDate>Fri, 01 Feb 2008 08:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1171</guid>
		<description>&lt;p&gt;[...] Один из разработчиков Spring Framework делится опытом, Storing Custom Fields in the Database [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Один из разработчиков Spring Framework делится опытом, Storing Custom Fields in the Database [...]</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jamaal</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1170</link>
		<dc:creator>Jamaal</dc:creator>
		<pubDate>Thu, 31 Jan 2008 21:54:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1170</guid>
		<description>&lt;p&gt;Thanks Arjen...&lt;/p&gt;

&lt;p&gt;I figured out what I made though, and it's an "Entity-Value-Relationship (EAV)" model, which is aggressively pooh-pooed by most people who mention it on the web.  After reading all that's been said, I still think that it's justified in my model, as it is only a portion of it (a 'mixed' EAV), and for the queries that I'm running, I value extensibility over speed.  Coincidentally, what I'm applying EAVs to is exactly what you chose to use as an example.  I think everybody who uses EAV modeling successfully is dealing with basically the same thing: many and varying potential fields on many different forms that need to be cross-queried.&lt;/p&gt;

&lt;p&gt;For anyone else trying to do something as foolhardy as I, here's two really useful links:&lt;/p&gt;

&lt;p&gt;"Dave's guide to the EAV"
http://weblogs.sqlteam.com/davidm/articles/12117.aspx&lt;/p&gt;

&lt;p&gt;And to measure the degree to which you'll take a performance hit:
http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=79043&lt;/p&gt;

&lt;p&gt;here's the seminal paper:
http://ycmi.med.yale.edu/nadkarni/Introduction%20to%20EAV%20systems.htm&lt;/p&gt;

&lt;p&gt;and here's some unbelievably aggressive pooh-pooing that nevertheless is very educational:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11&lt;em&gt;QUESTION&lt;/em&gt;ID:10678084117056&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks Arjen&#8230;</p>

<p>I figured out what I made though, and it&#8217;s an &#8220;Entity-Value-Relationship (EAV)&#8221; model, which is aggressively pooh-pooed by most people who mention it on the web.  After reading all that&#8217;s been said, I still think that it&#8217;s justified in my model, as it is only a portion of it (a &#8216;mixed&#8217; EAV), and for the queries that I&#8217;m running, I value extensibility over speed.  Coincidentally, what I&#8217;m applying EAVs to is exactly what you chose to use as an example.  I think everybody who uses EAV modeling successfully is dealing with basically the same thing: many and varying potential fields on many different forms that need to be cross-queried.</p>

<p>For anyone else trying to do something as foolhardy as I, here&#8217;s two really useful links:</p>

<p>&#8220;Dave&#8217;s guide to the EAV&#8221;
<a href="http://weblogs.sqlteam.com/davidm/articles/12117.aspx" rel="nofollow">http://weblogs.sqlteam.com/davidm/articles/12117.aspx</a></p>

<p>And to measure the degree to which you&#8217;ll take a performance hit:
<a href="http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=79043" rel="nofollow">http://www.pubmedcentral.nih.gov/articlerender.fcgi?artid=79043</a></p>

<p>here&#8217;s the seminal paper:
<a href="http://ycmi.med.yale.edu/nadkarni/Introduction%20to%20EAV%20systems.htm" rel="nofollow">http://ycmi.med.yale.edu/nadkarni/Introduction%20to%20EAV%20systems.htm</a></p>

<p>and here&#8217;s some unbelievably aggressive pooh-pooing that nevertheless is very educational:
<a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11" rel="nofollow">http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11</a><em>QUESTION</em>ID:10678084117056</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Arjen Poutsma</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1168</link>
		<dc:creator>Arjen Poutsma</dc:creator>
		<pubDate>Wed, 30 Jan 2008 20:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1168</guid>
		<description>&lt;p&gt;@Jamaal,&lt;/p&gt;

&lt;p&gt;It's all personal experience, I'm afraid :). I don't know of any books that cover this topic, though perhaps "Refactoring Databases", from the Martin Fowler signature series, does. I haven't read it (yet), though.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Jamaal,</p>

<p>It&#8217;s all personal experience, I&#8217;m afraid :). I don&#8217;t know of any books that cover this topic, though perhaps &#8220;Refactoring Databases&#8221;, from the Martin Fowler signature series, does. I haven&#8217;t read it (yet), though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jamaal</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1167</link>
		<dc:creator>Jamaal</dc:creator>
		<pubDate>Wed, 30 Jan 2008 18:30:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1167</guid>
		<description>&lt;p&gt;I just ran into this problem while trying to create a database that organized a large number of different applications (in the classical sense) for different services that needed to be easily mutable in order to add or take away fields based on new legal requirements, but in addition be cross application queryable, so I modeled the "meta-database" instinctively (I'm not as afraid of writing brutally huge queries as I probably should be).&lt;/p&gt;

&lt;p&gt;All I want to know is what reference material you were using for this blog entry, if it wasn't just personal experience.  I've been hammering google for days trying to get more information on this type of thing, and though I've already reinvented the wheel, I don't want to have to reperfect it.  I'm a little freaked out by the joins required for the average query and want an idea of the performance hit I'm going to take before I build it.&lt;/p&gt;

&lt;p&gt;thank ye...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I just ran into this problem while trying to create a database that organized a large number of different applications (in the classical sense) for different services that needed to be easily mutable in order to add or take away fields based on new legal requirements, but in addition be cross application queryable, so I modeled the &#8220;meta-database&#8221; instinctively (I&#8217;m not as afraid of writing brutally huge queries as I probably should be).</p>

<p>All I want to know is what reference material you were using for this blog entry, if it wasn&#8217;t just personal experience.  I&#8217;ve been hammering google for days trying to get more information on this type of thing, and though I&#8217;ve already reinvented the wheel, I don&#8217;t want to have to reperfect it.  I&#8217;m a little freaked out by the joins required for the average query and want an idea of the performance hit I&#8217;m going to take before I build it.</p>

<p>thank ye&#8230;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Arjen Poutsma</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1165</link>
		<dc:creator>Arjen Poutsma</dc:creator>
		<pubDate>Thu, 24 Jan 2008 12:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1165</guid>
		<description>&lt;p&gt;@Paul: yes, in the simplest version, you tend to use one data type for all custom fields, typically a varchar. However, in the meta database case, you can actually have multiple Value columns in the FieldValues table (i.e. StringValue, IntegerValue, DateTimeValue columns). This makes queries even harder, but it does work.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Paul: yes, in the simplest version, you tend to use one data type for all custom fields, typically a varchar. However, in the meta database case, you can actually have multiple Value columns in the FieldValues table (i.e. StringValue, IntegerValue, DateTimeValue columns). This makes queries even harder, but it does work.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Paul Bary</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1164</link>
		<dc:creator>Paul Bary</dc:creator>
		<pubDate>Thu, 24 Jan 2008 12:36:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1164</guid>
		<description>&lt;p&gt;One disadvantage you forgot to mention for each of the options except mutating table is that you lose the ability to have different database types.  For example, in the meta database FieldValues.value will be a varchar(255), which may not be appropriate for all custom fields, such as date fields.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>One disadvantage you forgot to mention for each of the options except mutating table is that you lose the ability to have different database types.  For example, in the meta database FieldValues.value will be a varchar(255), which may not be appropriate for all custom fields, such as date fields.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1161</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Thu, 24 Jan 2008 06:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1161</guid>
		<description>&lt;p&gt;I probably don't need to state the obvious, but when I allude to scientific apps having less "truisms", it's actually that they have more, but they are just more abstract. But that's another acid trip altogether ;-D&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I probably don&#8217;t need to state the obvious, but when I allude to scientific apps having less &#8220;truisms&#8221;, it&#8217;s actually that they have more, but they are just more abstract. But that&#8217;s another acid trip altogether ;-D</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marcus</title>
		<link>http://blog.springsource.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/comment-page-1/#comment-1160</link>
		<dc:creator>Marcus</dc:creator>
		<pubDate>Thu, 24 Jan 2008 05:59:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.springframework.com/arjen/archives/2008/01/24/storing-custom-fields-in-the-database/#comment-1160</guid>
		<description>&lt;p&gt;There's actually a hybrid that I would consider to be a fifth (I've also done a lot of thinking over a lot of years about this weakness of RDBMS'). It sounds like it is obvious, but the reality on the ground is I don't find a lot of people think like this: &lt;/p&gt;

&lt;p&gt;For some common scenarios it isn't a big stretch to just do a little more work to think out the truisms in the domain space. It's a bit of a chore the first time, but then it's pretty much the same over and over, and you end up with (1) a pattern that can be easily split across multiple one-to-one tables, if that's a performance consideration, and (2) a very small number of arbitrarily mapped fields, as in your "Fixed Table" pattern.&lt;/p&gt;

&lt;p&gt;The truisms aren't too hard to figure out, and they are mostly an exercise in careful logic. If you're talking about a User table, and you know that flexibility in the field set is highly valued, then you just work through the reasonable possibilities. The User table has an unusually high number of truisms to account for. Most other tables have very few. (People are complicated, and we want to dissect data about them in weird ways all the time.) &lt;/p&gt;

&lt;p&gt;In the end, with &lt;em&gt;extremely&lt;/em&gt; customizable apps, for ASPs, with salespeople that just can't say no, I've never needed more than 8 generic Fixed Table style fields to cover the truly unknowns, and truthfully, using more than 3 or 4 is a "data-smell". &lt;/p&gt;

&lt;p&gt;In an analysis of existing custom clients for an ASP that bends over backwards to touch the floor, only one client exceeded having 5 truly custom fields, and they were all horribly designed life cycle fields. The client was fired by the ASP anyway within the same month of my analysis for apparently different and long-standing "difficult client" issues, but I believe there is a high amount correlation between their many other problems and the fact that their data was hell.&lt;/p&gt;

&lt;p&gt;It's also helpful to consider life cycle event fields as a completely separate issue. Too often life cycle fields are bundled in with properties. It's serious problem masquerading as a non-issue. Life cycle data is 99 times out of a 100 strictly in the realm of truisms, and if that's not the case then there's a very good chance you're (1) not doing a business application (perhaps scientific?), or (2) need to hire a new head BSA/SA.&lt;/p&gt;

&lt;p&gt;Clearly this isn't for every application and I know people will be disbelieving if they haven't Just Tried It (tm) and will criticize the approach. That's fine. The Fixed Table approach works pretty well when this one is too big for the application. In my experience with over 15 years in the enterprise space, either Fixed Table or this hybrid are the only two I will select for an RDBMs though.&lt;/p&gt;

&lt;p&gt;Clearly the RDBMs vendors don't do a good job of allowing a multi-paradigm approach to one of the most significant problem in business schema design in existence. Sure they have their proprietary stuff, although there isn't even much of that. It's a big hole. LDAP is a useful consideration for some scenarios. And I think the big dream is that Semantic/RDF databases progress fast enough to make up for all this. &lt;/p&gt;

&lt;p&gt;I would also encourage critics of this approach, who say that having too many specific columns is a performance problem, that (1) this is a relatively easy performance issue to deal with, and (2) consider the overhead of the alternatives, and (3) why the !$!$! are you putting your CMS data in an RDBMs anyway (taking liberties in my assumptions). Hell! It's bad enough that you're putting customer properties in an RDBMs in the first place...but at least it can be reasonably workable. But get documents out of there, in a hurry!&lt;/p&gt;

&lt;p&gt;:-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>There&#8217;s actually a hybrid that I would consider to be a fifth (I&#8217;ve also done a lot of thinking over a lot of years about this weakness of RDBMS&#8217;). It sounds like it is obvious, but the reality on the ground is I don&#8217;t find a lot of people think like this: </p>

<p>For some common scenarios it isn&#8217;t a big stretch to just do a little more work to think out the truisms in the domain space. It&#8217;s a bit of a chore the first time, but then it&#8217;s pretty much the same over and over, and you end up with (1) a pattern that can be easily split across multiple one-to-one tables, if that&#8217;s a performance consideration, and (2) a very small number of arbitrarily mapped fields, as in your &#8220;Fixed Table&#8221; pattern.</p>

<p>The truisms aren&#8217;t too hard to figure out, and they are mostly an exercise in careful logic. If you&#8217;re talking about a User table, and you know that flexibility in the field set is highly valued, then you just work through the reasonable possibilities. The User table has an unusually high number of truisms to account for. Most other tables have very few. (People are complicated, and we want to dissect data about them in weird ways all the time.) </p>

<p>In the end, with <em>extremely</em> customizable apps, for ASPs, with salespeople that just can&#8217;t say no, I&#8217;ve never needed more than 8 generic Fixed Table style fields to cover the truly unknowns, and truthfully, using more than 3 or 4 is a &#8220;data-smell&#8221;. </p>

<p>In an analysis of existing custom clients for an ASP that bends over backwards to touch the floor, only one client exceeded having 5 truly custom fields, and they were all horribly designed life cycle fields. The client was fired by the ASP anyway within the same month of my analysis for apparently different and long-standing &#8220;difficult client&#8221; issues, but I believe there is a high amount correlation between their many other problems and the fact that their data was hell.</p>

<p>It&#8217;s also helpful to consider life cycle event fields as a completely separate issue. Too often life cycle fields are bundled in with properties. It&#8217;s serious problem masquerading as a non-issue. Life cycle data is 99 times out of a 100 strictly in the realm of truisms, and if that&#8217;s not the case then there&#8217;s a very good chance you&#8217;re (1) not doing a business application (perhaps scientific?), or (2) need to hire a new head BSA/SA.</p>

<p>Clearly this isn&#8217;t for every application and I know people will be disbelieving if they haven&#8217;t Just Tried It &#8482; and will criticize the approach. That&#8217;s fine. The Fixed Table approach works pretty well when this one is too big for the application. In my experience with over 15 years in the enterprise space, either Fixed Table or this hybrid are the only two I will select for an RDBMs though.</p>

<p>Clearly the RDBMs vendors don&#8217;t do a good job of allowing a multi-paradigm approach to one of the most significant problem in business schema design in existence. Sure they have their proprietary stuff, although there isn&#8217;t even much of that. It&#8217;s a big hole. LDAP is a useful consideration for some scenarios. And I think the big dream is that Semantic/RDF databases progress fast enough to make up for all this. </p>

<p>I would also encourage critics of this approach, who say that having too many specific columns is a performance problem, that (1) this is a relatively easy performance issue to deal with, and (2) consider the overhead of the alternatives, and (3) why the !$!$! are you putting your CMS data in an RDBMs anyway (taking liberties in my assumptions). Hell! It&#8217;s bad enough that you&#8217;re putting customer properties in an RDBMs in the first place&#8230;but at least it can be reasonably workable. But get documents out of there, in a hurry!</p>

<p> <img src='http://blog.springsource.com/arjen/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
</channel>
</rss>
