从“本地”迁移到“本地” OODBMS 到 ORM(实体框架/SQL Server)
不久前,我们开始开发一个新项目,该项目内部有大约 25-30 个不同的类/类型/模型,这些类/类型/模型通过 1:n、n:m 或 n:1 关系彼此密切相关。
当时我们使用本机 .net oodbms 系统,基本上是因为它允许我们做的就是采用我们的对象模型,并简单地到处添加一些与持久性相关的方法(调用),然后我们就可以开始了。 然而,随着时间的推移,我们遇到了越来越多的警告,非常糟糕的、不可修复的(在合理的时间范围内)限制,迫使我们实施缓慢的解决方法,导致平庸的性能和可扩展性问题即将出现,并且许可费用几乎增加了对我们来说是 5 倍,我们这边没有任何变化(他们被大公司收购了)。
因此,我们目前开始寻找可扩展性/性能以及维护方面的长期解决方案。 我们研究了其他“真正的”oodbms,并且总是遇到主要的破坏者,因此我们开始看得更远,现在基本上正在考虑 ORM,这希望让我们将大部分注意力集中在我们的对象上与 SQL 的争论。
所以基本上我的问题是:是否有人对 Microsoft 的实体框架或任何其他 .NET ORM 有任何实际经验,可以使配置尽可能保持可维护性,并在密切/密切相关的实体中表现良好? 我们存储的数据量无论何种类型都并不惊人或广泛(我们预计未来 3 年内所有实体的实例总数将达到 10 万个)。
有人对 ORM 有任何想法/建议和/或从 oodbms 迁移到 rdbms 的经验吗?
A while ago we started developing a new project which internally has about 25-30 different classes/types/models that are heavily related to each other either via 1:n, n:m or n:1 relationships.
Back then we went with a native .net oodbms system basically because what it allowed us to do was to take our object model and simply add a few persistence related methods(-calls) here and there and we were ready to go. However, over time we ran into more and more caveats, really bad, non-fixable (within a reasonable timeframe) limitations that forced us to implement slow workarounds resulting in mediocre performance and scalability issues on the horizon and license fees have almost increased by a factor of 5 for us with no change on our end (they got bought by big inc.).
Therefore we're currently starting to look for a long-term solution in terms of scalability/performance as well as maintenance. We had a look at other "real" oodbms'es and always came across major breakers for us and therefore we started to look a little further and basically are thinking about ORMs now, which hopefully let us keep most of the focus on our objects instead of wrangling with SQL.
So basically here's my Question: does anyone have any real-world experience with Microsoft's Entity Framework or any other .NET ORM that keeps configuration as maintainable as possible as well as performs well in closely/heavily related entities? The amount of data we store is not amazing or extensive in any sort (we expect a total of 100k instances across all entities within the next 3 years).
Does anyone have any ideas/suggestions for an ORM and/or experience migrating from an oodbms to rdbms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
由于您已经有一个现有的对象模型并且您正在寻求迁移到 ORM 解决方案,那么我认为 NHibernate 肯定是一个不错的选择。 原因如下:
为此使用实体框架将更具挑战性。 虽然实体框架在很多方面都是一个功能强大的 ORM,但它并不像 NHibernate 那样成熟,在这种情况下有几个原因,特别是我认为它可能不是最好的选择:
总的来说,我认为,对于对象优先开发,或者尝试利用现有对象模型,NHIbernate 是更好的选择。 对于以数据为中心的开发,实体框架(或 linq to sql 甚至 subsonic)成为更可行的选择。
您可能还想评估商业 ORM 产品,例如 Lightspeed - 我经验很少我自己使用了这个特殊的工具(当有很好的免费替代品时,客户通常反对支付 ORM 费用),但它受到高度重视。
As you have an existing object model and you are looking to migrate to an ORM solution then I would say NHibernate would certainly be a good choice. Here's why:
Using Entity Framework for this will be more challenging. While entity framework is a capable ORM in many respects, it is not as mature as NHibernate and there are a few reasons in this case specifically why I think it's probably not the best choice:
Overall, in my opinion, for object-first development, or where you are trying to leverage an existing object model, NHIbernate is a better choice. For data-centric developments, the Entity Framework (or linq to sql or even subsonic) become more viable choices.
You may also want to evaluate commercial ORM offerings such as Lightspeed - I have little experience with this particular tool myself (customers generally object to paying for an ORM when there are good free alternatives) but it is highly regarded.
我没有任何 OODBMS 的经验,但我在 NHibernate + MS SQL Server 方面的经验在一对多、多对一和多对多关系的强制和级联更改方面非常积极。
您使用什么 OODBMS 工具? OODBMS 可能 -> RDBMS 迁移工具存在,但我不知道。
I don't have any experience with OODBMSes, but my experience with NHibernate + MS SQL Server has been very positive in terms of enforcing and cascading changes down one-to-many, many-to-one and many-to-many relationships.
What OODBMS tool are you using? It might be possible that an OODBMS -> RDBMS migration tool exists, but I'm not aware of any.