ORM与Direct SQL-哪种方法是性能最好的方法 [英] ORM vs Direct SQL - which approach would be best one in performance

查看:374
本文介绍了ORM与Direct SQL-哪种方法是性能最好的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个基于域对象模型的Web应用程序,其中数据库表将映射到域对象.
多个表可能会映射到单个域对象.我想知道哪种域实体到数据库映射的解决方案在性能和可维护性方面适合我们

想知道我们需要实施哪种方法.要么去ORM要么去直接SQL

1. Linq to SQL
2.实体框架
3. nHibernate
4.存储过程

我们当前正在使用VS 2008和Sql Server2008.
我们大约有100个表格,60到70个对象和50个UI表单.

我们的应用范围更多地涉及CRU操作(创建,读取和更新),而较少的删除操作.

想知道您对哪种方法最好的一种建议的最佳建议.

解决方案

''就像想知道您对哪种方法最好的一种建议的最佳建议."
没有最佳"解决方案.每个项目都是不同的,取决于使用情况,将来的可扩展性,集成等.

还有其他与此类似的文章.根据您的需求进行研究并做出决定.
实体框架性能 [ 解决方案

''Like to know your valuable suggestion on which approach would be best one in performance."
There is no "best" solution. Every project is different and it depends on usage, future extensibility, integration, etc, etc.

There are other articles similar to this one. Research and make the decision based on your needs.
Entity Framework Performance[^]


Entity Framework is the MS suggested way to move ahead with new applications and where I see most of the support coming from the VS and third party tooling/controls . The new 5.0 version of it is the one which finally came up with the most basic set of enterprise wide usable functionalities (multiple resultsets, table params, enums, multiple shared view of modal, multi generation of Sps etc..., ).


IMHO scalability is very important, in other words how many users will use the app at the same time.
I did not see yet an app that is using the first 3 choices that can outperform a data layer using Stored Procedures.
LINQ, Entity and nHibernate do not render efficient SQL and my team spend quite some time in rewriting and optimizing auto generated code.


这篇关于ORM与Direct SQL-哪种方法是性能最好的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆