Entity Framework: Right Problem, Wrong Place

I was listening to the recent .NET rocks episode about the Entity Framework advisory council and it was interesting to hear the team's point of view and the problems they are trying to solve with the Entity Framework. They have nice goals, but there is a fundamental problem here that some of the original database gurus like C.J. Date make quite clear. SQL is flawed. It's not that we need a million object relational mappers or that we need to look at our databases in terms of objects. In fact, that's the opposite of what the relational model was intended to do. When E.F. Codd invented the relational model, he intended for the database to be a collection of facts with relationships to other facts... not a collection of objects. The relational model was supposed to provide a way to look at and work with these facts in different ways, but SQL and modern RDBMS's fall short of what they were supposed to do. Somewhere along the way, the original plans were lost. Instead of building a truely relational storage system, vendors jumped on the semi-relational SQL model. The SQL model ties physical structure closely to the logical data model, which is where a lot of problems start coming into play. This leads to the situations we've all seen where we need to denormalize the data model to get decent performance numbers.  It seems to me that the solution to the problem should not start with mapping the data to objects, it should start inside SQL Server itself, transitioning from the flawed world of T-SQL to a true implementation of the relational model as it was intended, a world where the physical model is truely detatched from the logical model.

Published Thursday, August 28, 2008 10:05 AM by Jesse Ezell
Filed under: , ,

Comments

# re: Entity Framework: Right Problem, Wrong Place

Thursday, August 28, 2008 10:54 AM by Kevin Hazzard

I agree that SQL and Oracle have taken a wrong turn. Although I don't know if it's that they strayed too far from basic relational database principles. It might be that they tried to adhere to them at all in the first place. Here's an interesting spin that you are welcome to disagree with. :)

www.gotnet.biz/.../An-Unfortunate-Consequence-of-History.aspx

# re: Entity Framework: Right Problem, Wrong Place

Thursday, August 28, 2008 11:35 AM by Michael K. Campbell

Sadly I have to disagree - at least in part.

You're spot on in terms of development - SQL doesn't quite cut the mustard, and is flawed from an object oriented perspective.

But what if you want to do something with your data? like look at relationships of facts to other facts? Querying objects for that kind of information would likely become very expensive. It likely would also be very hard to organize some of the relationships that make SQL so valid and useful.

# re: Entity Framework: Right Problem, Wrong Place

Thursday, August 28, 2008 12:53 PM by Jesse Ezell
Looking at the relationship of facts to other facts is exactly what the relational model was intended to do. I recommend reading C.J. Date's Database in Depth where he talks about the original intent compared to what SQL does. The relational model addresses relationships between facts very well, SQL does not.

The relational model as originally defined has nothing to do with performance, and that's why it is important to seperate the logical model from the physical model. However, SQL coupling the physical layout to the relational model, gives this idea that somehow the layout of the relationships effects performance. It shouldn't. An optimal physical layout should be able to be derived from the relationships which might be a completely denormalized database. However, this shouldn't be the way you design your relationships.

Objects are simply a view of the facts that you have defined. The relational model, as originally defined, would allow for much more seamless O/R mapping and data analysis, since views in the relationship model itself are fully updateable. In fact, tables themselves are not distinguishable from views in a system that implements the actual relational model, not a SQL based version of it.

Note, I'm not saying that SQL should be based on objects. I think 100% the opposite. The database should only be a collection of facts, nothing else. No objects, no tables. Just facts and relationships to other facts.

# re: Entity Framework: Right Problem, Wrong Place

Thursday, August 28, 2008 8:23 PM by David Douglass

"Somewhere along the way, the original plans were lost."  Not so!  Dr. Codd published them in 1990 as The Relational Model for Database Management: Version 2 (www.amazon.com/.../ref=sr_1_1).  Vendors (and just about everybody else) ignored this book.  Had people paid attention today's databases would have a much more solid foundation to build on.

# re: Entity Framework: Right Problem, Wrong Place

Friday, August 29, 2008 7:07 AM by Jesse Ezell

If only they'd listened... I think it's time that someone rebooted everything.

# re: Entity Framework: Right Problem, Wrong Place

Thursday, September 11, 2008 5:47 PM by Paramdeep Singh

It is sad to see so many smart people debating on a wrong concept. RDBMSs are right on target to provide what they were designed to do (SQL server/Oracle/DB2) etc. It is just an evolution path they are following just like any other technical production/framework. However most of the development community members are proficient in certain technologies and not all but very few are candid enough to admit so we all want the platform (we are proficient in) to support everything. Thus came the ORs. ORs do solve some Rapid Development Issues, they do improve the development life cycle for most of the simple technical solution, the problem starts when simple solution is extrapolated to complex solutions and that causes a disaster. I think we should

Leave a Comment

(required) 
(required) 
(optional)
(required)