Saturday, September 17, 2011

Can you ever really have two loves?

Listened to the #cfdevweek recording on the ORM/Hibernate in CF9 presentation by Bob Silverberg today. I have a lot of questions/reservations about how the interaction with the database is implemented.

Fundamentally, I guess it comes down to whether or not we ought to be writing ad-hoc queries or using stored procedures... As long as I have been a CF developer, I have had to talk to a database (12 years and running). In that time, I have slowly and painfully grown adept at optimizing SQL. Our shop is data heavy and it is not just my data, but data shared among many interconnected and complex systems and organizations. In my 3 years employ, I am a full convert to stored procedures for efficiency (reduce trips to the database server, one of the costliest transactions to a web request; stored procedures are compiled and execute quicker than ad-hoc queries in general), security (tight data typing, ability to lock down permissions), separation of concerns (Coldfusion should contain web server code, the database contains the SQL code), encapsulation, etc...

Anyway, I may not be making my case very articulately, but I am worried that there is now going to be pressure from the community to use ad-hoc queries. Hopefully, ORM will work with sprocs as well. Guess I should have asked that...

No comments: