问题描述
微软提供了许多不同的数据访问选项.哪一个最适合可扩展的应用程序?
There are so many different options coming out of microsoft for data access. Which one is the best for scalable apps?
Linq
我们应该使用 Linq 吗?这当然看起来很容易,但如果你知道你的 SQL 确实有帮助.另外我听说您不能使用 Linq 在 ASP.NET 中运行异步查询.因此我想知道它是否真的可扩展?有没有使用 Linq 的大型网站(stackoverflow 可能除外).
Should we be using Linq? It certainly seems easy but if you know your SQL does it really help. Also I hear that you can't run Async queries in ASP.NET using Linq. Therefore I wonder if it is really scalable? Are there any really big sites using Linq (With the possible exception of stackoverflow).
实体框架
不要听到太多关于实体框架的喧嚣.似乎更接近我熟悉的对象模型.
Don't hear so much razzmatazz about the Entity Framework. Seems closer to the Object model I'm familure with.
Astoria/动态数据
我们应该将我们的数据作为服务公开吗?
Should we be exposing our data as a service?
在我进入其他 ORM 产品(如 NHibernate)之前,我很困惑.有什么更好的想法或智慧吗?
I'm pretty confused and thats before I get into the other ORM products like NHibernate. Any ideas or wisdom on which is better?
推荐答案
我会推荐 NHibernate 或 Entity Framework.对于大型站点,我会使用 ADO.NET 数据服务.我不会用 LINQ to SQL 做任何大的事情.我认为 Stack Overflow 最终可能会出现一些有趣的规模问题,即 2 层而不是 3 层,并且随着数据库的物理方面的变化以及这些变化在整个代码中的影响,它们在重构时也会遇到一些麻烦.只是一个想法.
I would recommend either NHibernate or Entity Framework. For large sites, I'd use ADO.NET Data Services. I wouldn't do anything large with LINQ to SQL. I think Stack Overflow might end up with some interesting scale problems being 2-tier rather than 3-tier, and they'll also have some trouble refactoring as the physical aspects of the database change and those changes ripple throughout the code. Just a thought.
这篇关于可扩展性的最佳数据访问范式是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!