Monish Nagisetty's Space

Building connectivity on-premise, in the cloud and beyond

Active Record

A few days back, a colleague of mine showed me Castle Project’s ActiveRecord.  This neat little project is an implementation of the ActiveRecord design pattern.  It sits on top of NHibernate.  Go check it out!

My colleague and I also discussed some of the misconceptions about Object Relational Mappers.  There are people out there who believe ORM architectures generate inefficient SQL to carry out the standard CRUD tasks.  We even ventured into the whole debate of StoredProcedures vs Dynamic SQL. Which is faster? Turns out that the recent versions of MS SQL Server (2000 and 2005) has some optimizations to make both data access methods equally performant.

Most of the ORM tools meet the performance of regular stored procedures by using sp_executesql to carry out most of the SQL.  The difference is in the way SQL server caches the execution plan when using sp_executesql as opposed to exec.  See this article for more on this: http://www.sql-server-performance.com/stored_procedures.asp

January 19, 2007 Posted by | Database | | Leave a comment