简体   繁体   English

db4o体验?

[英]db4o experiences?

I'm currently trying out db4o (the java version) and I pretty much like what I see. 我目前正在尝试db4o(java版本),我非常喜欢我所看到的。 But I cannot help wondering how it does perform in a real live (web-)environment. 但我不禁想知道它在真实的(网络)环境中的表现如何。 Does anyone have any experiences (good or bad) to share about running db4o? 有没有人有任何关于运行db4o的经验(好的或坏的)?

We run DB40 .NET version in a large client/server project. 我们在大型客户端/服务器项目中运行DB40 .NET版本。

Our experiences is that you can potentially get much better performance than typical relational databases. 我们的经验是,与典型的关系数据库相比,您可以获得更好的性能。

However, you really have to tweak your objects to get this kind of performance. 但是,您必须调整对象才能获得此类性能。 For example, if you've got a list containing a lot of objects, DB4O activation of these lists is slow. 例如,如果您有一个包含大量对象的列表,则这些列表的DB4O激活速度很慢。 There are a number of ways to get around this problem, for example, by inverting the relationship. 有很多方法可以解决这个问题,例如,通过颠倒关系。

Another pain is activation. 另一个痛苦是激活。 When you retrieve or delete an object from DB4O, by default it will activate the whole object tree. 从DB4O检索或删除对象时,默认情况下它将激活整个对象树。 For example, loading a Foo will load Foo.Bar.Baz.Bat, etc until there's nothing left to load. 例如,加载Foo将加载Foo.Bar.Baz.Bat等,直到没有任何东西可以加载。 While this is nice from a programming standpoint, performance will slow down the more nesting in your objects. 虽然从编程的角度来看这很好,但性能会降低对象中嵌套的速度。 To improve performance, you can tell DB4O how many levels deep to activate. 为了提高性能,您可以告诉DB4O要激活多少级别。 This is time-consuming to do if you've got a lot of objects. 如果你有很多对象,这很费时间。

Another area of pain was text searching. 另一个痛苦的领域是文本搜索。 DB4O's text searching is far, far slower than SQL full text indexing. DB4O的文本搜索远远慢于SQL全文索引。 (They'll tell you this outright on their site.) The good news is, it's easy to setup a text searching engine on top of DB4O. (他们会在他们的网站上直接告诉你。)好消息是,在DB4O之上设置文本搜索引擎很容易。 On our project, we've hooked up Lucene.NET to index the text fields we want. 在我们的项目中,我们已经连接Lucene.NET来索引我们想要的文本字段。

Some APIs don't seem to work, such as the GetField APIs useful in applying database upgrades. 某些API似乎不起作用,例如GetField API在应用数据库升级时很有用。 (For example, you've renamed a property and you want to upgrade your existing objects in the database, you need to use these "reflection" APIs to find objects in the database. Other APIs, such as the [Index] attribute don't work in the stable 6.4 version, and you must instead specify indexes using the Configure().Index("someField"), which is not strongly typed. (例如,您已重命名属性并且想要升级数据库中的现有对象,您需要使用这些“反射”API来查找数据库中的对象。其他API,例如[Index]属性不要在稳定的6.4版本中工作,您必须使用Configure()。索引(“someField”)来指定索引,该索引不是强类型的。

We've witnessed performance degrade the larger your database. 我们目睹了性能下降,您的数据库越大。 We have a 1GB database right now and things are still fast, but not nearly as fast as when we started with a tiny database. 我们现在有一个1GB的数据库,而且事情仍然很快,但并不像我们开始使用一个小型数据库那么快。

We've found another issue where Db4O.GetByID will close the database if the ID doesn't exist anymore in the database. 我们发现了另一个问题,如果数据库中的ID不再存在,Db4O.GetByID将关闭数据库。

We've found the Native Query syntax (the most natural, language-integrated syntax for queries) is far, far slower than the less-friendly SODA queries. 我们发现Native Query语法(最自然,语言集成的查询语法)比不太友好的SODA查询慢得多。 So instead of typing: 所以不要输入:

// C# syntax for "Find all MyFoos with Bar == 23".
// (Note the Java syntax is more verbose using the Predicate class.)
IList<MyFoo> results = db4o.Query<MyFoo>(input => input.Bar == 23);

Instead of that nice query code, you have to an ugly SODA query which is string-based and not strongly-typed. 而不是那个好的查询代码,你必须有一个丑陋的SODA查询,它是基于字符串的而不是强类型的。

For .NET folks, they've recently introduced a LINQ-to-DB4O provider, which provides for the best syntax yet. 对于.NET人员,他们最近推出了一个LINQ-to-DB4O提供程序,它提供了最好的语法。 However, it's yet to be seen whether performance will be up-to-par with the ugly SODA queries. 然而,尚未看到性能是否与丑陋的SODA查询相提并论。

DB4O support has been decent: we've talked to them on the phone a number of times and have received helpful info. DB4O的支持很不错:我们已经多次通过电话与他们交谈,并收到了有用的信息。 Their user forums are next to worthless, however, almost all questions go unanswered. 他们的用户论坛几乎毫无价值,然而,几乎所有的问题都没有得到答复。 Their JIRA bug tracker receives a lot of attention, so if you've got a nagging bug, file it on JIRA on it often will get fixed. 他们的JIRA bug跟踪器受到了很多关注,所以如果你有一个唠叨的bug,把它归档到JIRA就可以得到修复了。 (We've had 2 bugs that have been fixed, and another one that got patched in a half-assed way.) (我们已经修复了2个错误,另一个错误修复了。)

If all this hasn't scared you off, let me say that we're very happy with DB4O, despite the problems we've encountered. 如果这一切都没有让你害怕,那就让我说我们对DB4O非常满意,尽管遇到了我们遇到的问题。 The performance we've got has blown away some O/RM frameworks we tried. 我们所获得的性能已经破坏了我们尝试过的一些O / RM框架。 I recommend it. 我推荐它。

update July 2015 Keep in mind, this answer was written back in 2008. While I appreciate the upvotes, the world has changed since then, and this information may not be as reliable as it was when it was written. 2015年7月更新请记住,这个答案是在2008年写回来的。虽然我很欣赏这些赞成,但自那时起世界发生了变化,而且这些信息可能不像编写时那样可靠。

Most native queries can and are efficiently converted into SODA queries behind the scenes so that should not make a difference. 大多数本机查询可以并且在幕后有效地转换为SODA查询,因此不应该有所作为。 Using NQ is of course preferred as you remain in the realms of strong typed language. 使用NQ当然是首选,因为您仍然使用强类型语言。 If you have problems getting NQ to use indexes please feel free to post your problem to the db4o forums and we'll try to help you out. 如果你在让NQ使用索引时遇到问题,请随时将你的问题发布到db4o论坛 ,我们会尽力帮助你。

Goran 戈兰

Main problem I've encountered with it is reporting. 我遇到的主要问题是报告。 There just doesn't seem to be any way to run efficient reports against a db4o data source. 似乎没有任何方法可以针对db4o数据源运行有效的报告。

Judah, it sounds like you are not using transparent activation, which is a feature of the latest production version (7.4)? 犹大,听起来你没有使用透明激活,这是最新生产版本(7.4)的功能? Perhaps if you specified the version you are using as there may be other issues which are now resolved in the latest version? 也许您指定了正在使用的版本,因为可能还有其他问题现在已在最新版本中解决了?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM