LINQ and performance

From: Ally20 Nov 2010 00:13
To: THERE IS NO GOD BUT (RENDLE) 1 of 5

(specifically addressing this to Rendle because, come on, who am I kidding if I address it to all?)

 

I was wondering if you could do me a favour and dispense some experty .NET advice. My work has recently upgraded from .NET 2.0 to 4.0, at the same time as I'm starting work on a new project that will use SQL Server, but with a good chance that it'll shift to MySQL at some point in the future.

 

So I'm keen to use some sort of abstraction layer. LINQ appears to have an adapter for MySQL and would seem ideal. I've seen you speak highly about it before- but is having an entire site's data access layer comprise of LINQ even a sensible idea? Are there performance issues?Right now we have stored procedures that do things like create temporary tables- I'm assuming there is no equivalent in LINQ, and we'd have to still implement stored procedures?

From: THERE IS NO GOD BUT (RENDLE)20 Nov 2010 13:01
To: Ally 2 of 5

LINQ is more of an abstraction over query-like operations than a database adapter. It's very good for writing expressive code that can be optimised at runtime by the underlying provider.

 

If you're looking to implement a proper Data Access Layer, I suggest looking at NHibernate, which has MySQL support and a LINQ provider. It will also let you map specific operations to Stored Procedures.

From: Ally20 Nov 2010 21:41
To: THERE IS NO GOD BUT (RENDLE) 3 of 5
Ah, yes- the more I read, the more I realise that when I was talking about LINQ, I was more talking about LINQ to SQL.

NHibernate looks very interesting. Googling around that I found DataObjects.net- I don't think that the cost of licensing it would be an issue and it appears to have both better LINQ support and better performance. I guess I'll try setting them both up and seeing which one works best.
From: THERE IS NO GOD BUT (RENDLE)20 Nov 2010 22:28
To: Ally 4 of 5

I wouldn't touch DataObjects with a 10-foot pole. It's an odd little proprietary thing without much of a user base. You should evaluate NHibernate and Entity Framework 4 to see which suits you best; you'll be able to get help with either of those on StackOverflow.

 

If you've got some money to spend, I recommend looking at LLBLGen to make your life easier.

From: Ally20 Nov 2010 22:50
To: THERE IS NO GOD BUT (RENDLE) 5 of 5

Ah, thanks for the warning. I've already seen plenty of NHibernate posts on Stack Overflow, I can see how that is going to be a useful resource. Thanks for the help- I'll recommend we pick up LLBLGen. One of the reasons I was looking outside of NHibernate was the idea of the XML configuration files. A GUI will go a long way to avoiding that problem...

 

EDIT: Just seen Fluent NHibernate, too. Interesting.

EDITED: 20 Nov 2010 22:56 by ALLY