Best data access method for MVC 3 site with SQL Server backend
I'm building a new website using MVC3 with all data being stored in SQL Server, and I need input in choosing the best data access method.
My priorities are: - Performance (fast processing, low memory/CPU usage) - Scalability (easy to grow from 1k to 100k daily users) - Extensebility (adding/modifying data structure without tedious changes in multiple places)
Thanks in advance for a开发者_如何学编程ny input.
I would go with NHibernate I suppose.....
If this is a new application with a new DEDICATED database then I would take a look at Entity Framework Code First.
If you have an existing database then pick a more traditional ORM tool...
Scalability (easy to grow from 1k to 100k daily users) - Extensebility (adding/modifying data structure without tedious changes in multiple places)
Sounds like you want the cake and to eat it all too :)
Given the scalability requirements i think you have some very important research to do first before you make your choice.
Be aware that even with an ORM (in my case EF) 'tedious changes', or should i say 'repetitive' maintenance does still occur when you are modifying your schema.
I would look into...
- EF (code first and model first)
- NHibernate
- Dapper
Note that Dapper is a Micro ORM and considered more lightweight than the first 2. It is also used on this very site.
精彩评论