实体框架4 - 处理非常大的(1000+表)数据模型? [英] Entity Framework 4 - Handling very large (1000+ tables) data models?

查看:115
本文介绍了实体框架4 - 处理非常大的(1000+表)数据模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个超过1000多个表的数据库,并且想考虑使用EF4作为数据访问层,但是我担心将其用于如此大的数据模型的实际现实。我看过这个问题并阅读有关建议的解决方案这里这里。这些可能会起作用,但似乎是指实体框架的第一个版本(并且比我想要的更复杂)。有没有人知道在EF4中这些解决方案是否得到改善?还有其他建议在一起吗?谢谢。

We've got a database with over 1000+ tables and would like to consider using EF4 for our data access layer, but I'm concerned about the practical realities of using it for such a large data model. I've seen this question and read about the suggested solutions here and here. These may work, but appear to refer to the first version of the Entity Framework (and are more complex than I'd like). Does anyone know if these solutions have been improved upon in EF4? Or have other suggestions all together? Thanks.

更新:在进行EF工作的一些尝试之后,我决定放弃这个项目。大数据模型的支持并不存在,虽然可能会出现问题(例如,编辑和维护与设计师无关的xml),但是他们并没有为黄金时段做好准备。对我来说最有问题的是,EF不会在跨多个XML文件分散的域模型中运行良好,而没有很多冗余和重复的代码。我仍然可以接受建议(我知道我没有剥离EF洋葱的所有层),但是现在,我正在没有EF。

UPDATE: After a number of attempts at making EF work, I've decided to abandon it all together for this project. Large data model support just isn't there and while there may be work arounds (e.g. editing and maintaining the xml independent of the designer), they just don't feel ready for prime time. Most problematic for me is the fact that the EF doesn't work well with the domain model spread across multiple XML files without a lot of redundancy and duplication of code. I'm still open to suggestions (I know I haven't peeled back all layers of the EF onion), but for now, I am moving on without EF.

更新#2:看起来像挂起的代码首先支持(目前在 EF4 CTP4 )可能最终成为我们想要的解决方案,因为它需要设计师和大型XML文件维护才能播放。

UPDATE #2: It looks like the pending code first support (currently in EF4 CTP4) is likely to end up being the solution we want as it takes the designer and large XML file maintenance out of play.

推荐答案

我在微软截屏中听到的数字最多为每个EF模型大约250个表。这并不意味着EF不能处理更多 - 将1000个表分解成几个逻辑组的表可能是合理的,并且每个逻辑组使用一个EF模型(最多可以有250个表)。

The number I heard in a Microsoft screencast is a maximum of roughly 250 tables per EF model. That doesn't mean EF can't handle more - it might just be sensible to break up your 1000+ tables into several logical groups of tables, and use one EF model per such logical group (with up to 250 tables in it).

我非常怀疑你会有一次需要使用所有1000张表的查询 - 很可能一次甚至不能10张。所以你一定能够将你的漂亮的大型模型分成更小的集群,并将它们分成一个单独的EF模型。

I highly doubt you'll have queries that will need to use all 1000 tables at once - most likely not even 10 at once. So you should definitely be able to split up your pretty large model into smaller clusters and turn each into a separate EF model.

这篇关于实体框架4 - 处理非常大的(1000+表)数据模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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