0

Which way should I use to create a scalable system in C# ASP.NET MVC 5 ?

Should I use stored procedure way or Entity Framework way to connect to database?

One of our head is insisting to use stored procedure way, even for all inserts, deletes, searches etc.

Which one is better, in terms of performance? I want to create a online test paper, which will parallely be taken by some 500 people at a time, each having some 50 questions.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sreejith
  • 23
  • 7
  • From my expirience, EF is way slower than stored procedures but I do not think that 500 requests is enough to see the difference. Hence I would recommend using EF, performance in your case **shouldn't** be a problem I would go for readability and easy written code. – MaLiN2223 Feb 04 '17 at 05:12

5 Answers5

0

I think you can refer to the question Entity Framework Vs Stored Procedures - Performance Measure

If development time is not a criteria then you can go for stored procedures. There are many other issues with using stored procedures like maintainability, ability to write tests etc. As the commented by MaLiN2223 in your case performance difference may not be significant to justify the extra effort in writing procedures.

Community
  • 1
  • 1
Vijay
  • 523
  • 4
  • 13
0

You can try out other ORM - Dapper you can see the benchmark of store procedure vs EF vs Dapper

0

Its depend on many factors some time you felt this is quite easy to use within application and after sometime when data will be bigger time to time you have to think again.

So refer this to regard entity framework performance

so you easily understand. I would like to give you one more refrence of one open source project so this will help you i hope. http://www.nopcommerce.com/

when you see this application code this is really optimise use of EF. Thanks

Dharmeshsharma
  • 683
  • 1
  • 11
  • 28
0

On a very high level note, if you already have a database setup, use Entity Framework if you need to add, update or delete a record as part of your functionality. EF has different configuration options to dictate how the model changes are saved to the database.

If you have bulk batch changes, using EF will be tricky with the whole LINQ and SQL to and fro. However, there's extensions on EF which allow bulk operations. Stored procedures gets rid of this fuss. But LINQ has its own benefits with Type safety, being testable, etc.

Teja
  • 305
  • 1
  • 6
0

By looking at number of users, you can use either. You won't see much performance difference. My experience is that, by using entity framework, you can develop it faster that stored procedures. Using dapper with the stored procedure can be an other way. To be frank, you can only observe that performance difference with large databases.

Pavvy
  • 353
  • 3
  • 6
  • 15