﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Ayende Rahien commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>Peter,
  
Please read this part, it hit upon my thinking very well.
  
http://www.evanhoff.com/archive/2007/06/05/19.aspx
  
  
SQL has very poor support for abstraction, encapsulation, reuse, etc.
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment13</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment13</guid><pubDate>Fri, 30 Nov 2007 21:40:07 GMT</pubDate></item><item><title>Stan commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>I almost wept when I saw a column called OrganizationUnit. We'd be lucky to get something as readable as ORG_UNT out of our DBAs. :-)  And making column names match Java field names ... wouldn't that open the risk of using an ORM tool instead of writing millions of lines of code?
  
  
Seriously, good post. I was exposed to the all metadata all the time horror only once and the others not at all, I think, but they are certainly out there.
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment12</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment12</guid><pubDate>Fri, 30 Nov 2007 15:22:07 GMT</pubDate></item><item><title>Ayende Rahien commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>A DB that has the following tables
  
  
   1. Schemas
  
   2. Tables
  
   3. Columns
  
   4. Rows
  
   5. Values
  
  
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment11</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment11</guid><pubDate>Fri, 30 Nov 2007 11:25:52 GMT</pubDate></item><item><title>Ayende Rahien commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>Perter,
  
Sometimes you get the easy way by mentoring, but you have to have some way to feel the pain.
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment10</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment10</guid><pubDate>Fri, 30 Nov 2007 11:10:23 GMT</pubDate></item><item><title>Ayende Rahien commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>Jose, thanks.
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment9</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment9</guid><pubDate>Fri, 30 Nov 2007 11:04:21 GMT</pubDate></item><item><title>Ayende Rahien commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>Steve,
  
You are correct in your approach, certainly.
  
The different is that SQL offers a lot of rich tools for doing reports, while any other method means that I have to write it from scratch.
  
The basic idea is that you can offload that to the end user, and tell them that it is a way they can write their own stuff easily
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment8</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment8</guid><pubDate>Fri, 30 Nov 2007 11:02:50 GMT</pubDate></item><item><title>Darius Damalakas commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>"I have made the 5-tables mistake before, I"
  
  
What is that 5-table mistake?  How can i know that i have or have not made it?
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment7</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment7</guid><pubDate>Fri, 30 Nov 2007 10:55:06 GMT</pubDate></item><item><title>Markus Zywitza commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>"""We probably want the usual auditing suspects, such as Id, CreatedAt, ModifiedAt, CreatedBy, ModifiedBy, Owner, OrganizationUnit. Maybe a few more, if this makes sense. Probably not too much, because that can get to be a problem."""
  
  
I strongly disagree here. Auditing info is IMO nothing that should be part of the entity itself, unless it's an integral part of the model's business needs.
  
My solution here is different: I have separate changelog and changelogdetails tables. Any changes to entities that need to be monitored are logged to that tables by using the proper ActiveRecord/NHibernate hooks. This allows auditing entities by simply changing their base class instead of adding and maintaining a bunch of attributes on the entities themselves.
  
  
And yes, even for account entities, auditing attributes are not an integral part of the business model, but the best example for why auditing changes is required in enterprise apps.
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment6</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment6</guid><pubDate>Fri, 30 Nov 2007 08:44:47 GMT</pubDate></item><item><title>Petar Repac commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>&gt;No business logic in the DB! This is important, if you put business logic in the DB, you have to get to the DB in order to execute the business logic.
  
  
In my experience almost every business logic (BL) changes some data so in majority of cases you must access database any way. If BL is in the middle tier you will probably round-trip to the database many times (many UPDATES, INSERTS and DELETES). If you put your BL in DB round-trip number will be lower, possibly just 1. And your business logic gets enforced even if you access DB directly and not through your middle tier. Don't forget that customer data will live a great longer than your application. 
  
  
Let's not forget that at least some part of BL is always in DB. Constraints. And those come in to flawors: declarative and procedural. Declarative constraints should obviously be put in DB. Procedural constraints, well you could probably put those in DB or in the middle tier.
  
  
Don't get me wrong. I am not advocating that we should always put BL in DB (support for many DBMS is an example when we should minimize BL in DB). But to say that we should never do that seems equally wrong to me. I is an "it depends" decision I guess.
  
  
&gt;This kills scalablity, 
  
Seems to me that DBMS are more scalable then some custom middle tier or IIS. 
  
  
&gt; hurts the ability to understand the solution, 
  
Why ? PL/SQL is harder to understand than C# ?
  
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment5</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment5</guid><pubDate>Fri, 30 Nov 2007 08:34:59 GMT</pubDate></item><item><title>Joshua McKinney commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>Oren,
  
There was a post of your's quite some time ago where you pointed out an object model for looking at objects that change over time (you had a .At(time) method on them or something like that). Would it be reasonable to use that rather than just the created / modified time / user? 
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment4</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment4</guid><pubDate>Fri, 30 Nov 2007 00:06:34 GMT</pubDate></item><item><title>Peter w commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>One thing we have in common is the ability to look at a database schema design, classify it into a familiar pattern, and identify its strengths and weaknesses.
  
  
I have found that the best way to design a database schema is direct from the use cases. The use cases define how data is loaded and persisted. The more frequent use cases have the highest priority, but the database ultimately must satisfy all of the use cases in a simple manner.
  
  
I have made the 5-tables mistake before, I have made the blob mistake before. Heck I have even attempted to push all of my business logic in to the stored procedures before (talk about refactoring nightmare!)
  
  
I like to think that my skill has been earned simply from doing things the wrong way so many times before!
  
  
My point is, your post is a "don't make stupid mistakes" post, but it comes from hard-earned knowledge... I sometimes wonder if everyone must make these stupid mistakes to appreciate the "best practices"
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment3</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment3</guid><pubDate>Thu, 29 Nov 2007 22:13:41 GMT</pubDate></item><item><title>Jose  commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>Oren, I think your posts are very informative, its nice to see smart people writing about what should and should not be done when programming and also trying to find better ways to do things.
  
  
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment2</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment2</guid><pubDate>Thu, 29 Nov 2007 19:00:39 GMT</pubDate></item><item><title>Steve Campbell commented on A vision of enterprise platform: A database that you don't hide in the attic</title><description>I think there is a pattern for reports that is broadly applicable, but hardly ever implemented.  The pattern is to split the 5 aspects of reports, which are Options (parameters), Provider (runs the report), Data Adapter (fetches the data), Data (represents the data) and Presentation.  
  
  
The point I want to make is this: When you talk of SQL Views for reports, you are suggesting that the Data Adapter logic be encapsulated in the database - the very thing you just recommended against doing for other types of logic.
  
  
Your report-security sidetrack became necessary because your data logic  was in the database.  If you move your data logic out of the database, then security is much easier to apply.
  
  
Only in recent years has this become possible, because many reporting tools now allow reporting off of non-database representations of data (xml, datasets, etc).
</description><link>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment1</link><guid>http://ayende.com/2978/a-vision-of-enterprise-platform-a-database-that-you-dont-hide-in-the-attic#comment1</guid><pubDate>Thu, 29 Nov 2007 18:37:43 GMT</pubDate></item></channel></rss>