Click here to Skip to main content
15,921,467 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
User 483504718-Oct-13 10:56
User 483504718-Oct-13 10:56 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Ranjan.D18-Oct-13 10:44
professionalRanjan.D18-Oct-13 10:44 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 10:50
Christopher Duncan18-Oct-13 10:50 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Ranjan.D18-Oct-13 11:08
professionalRanjan.D18-Oct-13 11:08 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 11:44
Christopher Duncan18-Oct-13 11:44 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Jörgen Andersson18-Oct-13 11:10
professionalJörgen Andersson18-Oct-13 11:10 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 11:11
Christopher Duncan18-Oct-13 11:11 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Rutvik Dave18-Oct-13 10:56
professionalRutvik Dave18-Oct-13 10:56 
Following is my comparision between Entity Framework (ORM that uses LINQ) and Stored Procedures.

Stored Procedure Pros: Much faster performance over EF/LINQ, Could be updated without recompiling the code based since it's in the database, better separation of logic, you could utilize your DBAs, Works even if the database structure / design is poor, Much better security.
Cons: Slow development process, unnecessary / repeated coding, No flexibility - works on only one database (I mean someday your management/client wants to move to MySQL from SQL Server, you will have to rewrite everything). Need extensive knowledge of database (I mean just knowing front-end language doesn't work). Maintain two separate things. Unit Testing nightmare.

Entity Framework Pros: Crazy fast development time (you could skip one or two phases), Querying is very easy, Works even if you know only Front-End language, Flexible - you can change underlying database without changing your code base, Start coding without planning everything in advanced (for SP you need to create it first before you do anything), Only one code base to maintain, Code-First migrations makes seamless database changes (Just rebuilt the solution and push it, Magic!), If you need performance boost at particular scenario you can still use stored procedure and call it as a method.
Cons: Requires almost perfect database structure/design (all the primary keys, foreign keys, constraints, normalized tables etc.), performance is not as good as SP (but you can use SP in that case, or buy a better hardware, or implement caching), your DBAs are now idle, Security is not as good as SP (Mostly any developer can do anything, in case of SP you could restrict the access of the SP and Tables to certain users), every minor changes in database call requires complete recompilation of code base.

Also once you know LINQ, you can use it against XML, CSV and many other data structures.

I have used EF in our latest product and it works great, few places where the performance was affected due to recursive call to methods, I changed it to stored procedures and now it's fine. I really like the abstraction and flexibility ORM offers. And now I only occasionally open SQL Server Management Studio, one less window to worry about. Smile | :)

GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 11:45
Christopher Duncan18-Oct-13 11:45 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
jschell18-Oct-13 12:46
jschell18-Oct-13 12:46 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 15:04
Christopher Duncan18-Oct-13 15:04 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
jschell21-Oct-13 9:15
jschell21-Oct-13 9:15 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan21-Oct-13 10:18
Christopher Duncan21-Oct-13 10:18 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Mycroft Holmes18-Oct-13 12:48
professionalMycroft Holmes18-Oct-13 12:48 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 15:07
Christopher Duncan18-Oct-13 15:07 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
PIEBALDconsult18-Oct-13 13:22
mvePIEBALDconsult18-Oct-13 13:22 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 15:11
Christopher Duncan18-Oct-13 15:11 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Marc Clifton18-Oct-13 13:27
mvaMarc Clifton18-Oct-13 13:27 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan18-Oct-13 14:55
Christopher Duncan18-Oct-13 14:55 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
GuyThiebaut19-Oct-13 3:55
professionalGuyThiebaut19-Oct-13 3:55 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan19-Oct-13 6:10
Christopher Duncan19-Oct-13 6:10 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
PIEBALDconsult19-Oct-13 19:28
mvePIEBALDconsult19-Oct-13 19:28 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
GuyThiebaut20-Oct-13 1:22
professionalGuyThiebaut20-Oct-13 1:22 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
_Maxxx_20-Oct-13 13:03
professional_Maxxx_20-Oct-13 13:03 
GeneralRe: Another religious question: LINQ vs stored procedures Pin
Christopher Duncan21-Oct-13 1:06
Christopher Duncan21-Oct-13 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.