views:

458

answers:

3

I want to know few things about ASP.NET MVC with NHibernate.

  1. Is NHibernate the best ORM used with ASP.NET MVC?
  2. If so, will NHibernate slow down the application?
  3. What can be done to improve performance of an ASP.NET MVC application with NHibernate?
+3  A: 
  1. There is no best ORM to use with ASP.NET MVC. The best ORM is the one which meets your needs.
  2. No, there is nothing inherent in NHibernate that will slow down your application.
  3. Don't worry so much about performance unless it becomes a problem in the future. Is there a good reason why you have such high performance requirements?
lfoust
+9  A: 
  1. Depends. If you are a total newbie you might want to try entity framework because it contains all the ORM designer classes that allows you to create entity class by drag and drop.
  2. No, it won't. NHibernate is used by a lot of sites, and it has first and second level caching feature that would speed things up by caching the previous operation, so performance isn't really an issue.
  3. You can only improve your app after you identify the bottleneck. Don't premature optimize.
Ngu Soon Hui
The Entity Framework is not for newbies (then again, no ORM is).
Michael Maddox
Perhaps some Linq To Sql won't hurt..
Black Horus
+5  A: 

I use NHibernate with ASP.NET MVC for GarageCommerce.com and it is very fast even on pretty low budget hardware. The overhead of NHibernate is negligible compared to the raw cost of talking to a database.

There is a strong community, proven patterns to follow and support tools like NHibernate Profiler. It's likely that you would end up with a more efficient application than if you had rolled your own database access.

You have a better chance of solving scalability issues with a powerful tool like NH. You can turn on it's 2nd level cache and back it with memcache. There is also work on NHiberate.Shards to help you horizontally partition your data.

Michael Valenty
Thanks micheal it was very useful
Pandiya Chendur