Derby 与 PostgreSql 性能比较

发布于 2024-08-19 09:42:09 字数 158 浏览 6 评论 0原文

我们现在正在研究是否将 postgresql 数据库切换到嵌入式 Derby 数据库。两者都将使用 glassfish 3 作为我们的数据层。有人有任何意见或知识可以帮助我们做出决定吗?

谢谢!

编辑:我们现在正在自己编写一些性能测试。更多地基于经验/第一手知识寻找答案

We are doing research right now on whether to switch our postgresql db to an embedded Derby db. Both would be using glassfish 3 for our data layer. Anybody have any opinions or knowledge that could help us decide?

Thanks!

edit: we are writing some performance tests ourselves right now. Looking for answers more based on experience / first hand knowledge

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

野稚 2024-08-26 09:42:09

我知道我在这里发布答案已经晚了,但我想确保将来没有人会犯在任何生产质量数据库上使用 Derby 的错误。对于这个答案的负面程度,我提前表示歉意 - 我试图通过简短的问答来表达整个工程团队的不良情绪。

我们在许多小型客户部署中使用 Derby 的经验让我们严重怀疑它对于除了测试环境之外的任何其他环境都有多大用处。我们遇到的一些问题:

  • 由锁升级引起的死锁 - 这是最大的一个,大约每周或两次发生在一位客户身上
  • 中断的 I/O 导致 Derby 在 Solaris 上彻底失败(在其他平台上可能不是问题) - 我们必须构建一个垫片来保护它免受这些故障的影响
  • 无法处理 MySQL/PostgreSQL 可以轻松处理的复杂查询有
  • 缺陷的事务日志实现导致表损坏,这需要我们导出数据库然后重新导入它(可能不只是删除损坏的表),而且我们仍然在此过程中丢失了表 - 谢天谢地,我们有备份
  • LIMIT 语法
  • 复杂查询性能低
  • 大型数据集性能低

由于以下事实由于它是嵌入式的,Derby 更像是 SQLite 的竞争对手,而不是 PostgreSQL,后者是一个极其成熟的生产质量数据库,世界上一些最大的网站使用它来存储多 PB 数据集。如果您想为增长做好准备,并且不想调试别人的数据库代码,我建议您不要使用 Derby。我没有任何使用 SQLite 的经验,但我无法想象它对我们来说比 Derby 更不可靠,但仍然如此受欢迎。

事实上,我们现在正在移植到 PostgreSQL。

I know I'm late to post an answer here, but I want to make sure nobody makes the mistake of using Derby over any production-quality database in the future. I apologize in advance for how negative this answer is - I'm trying to capture an entire engineering team's ill feelings in a brief Q&A answer.

Our experience using Derby in many small-ish customer deployments has led us to seriously doubt how useful it is for anything but test environments. Some problems we've had:

  • Deadlocks caused by lock escalations - this is the biggest one and happens to one customer about once every week or two
  • Interrupted I/Os cause Derby to fail outright on Solaris (may not be an issue on other platforms) - we had to build a shim to protect it from these failures
  • Can't handle complicated queries which MySQL/PostgreSQL would handle with ease
  • Buggy transaction log implementation caused a table corruption which required us to export the database and then re-import it (couldn't just drop the corrupted table), and we still lost the table in the process - thank goodness we had a backup
  • No LIMIT syntax
  • Low performance for complicated queries
  • Low performance for large datasets

Due to the fact that it's embedded, Derby is more of a competitor to SQLite than it is to PostgreSQL, which is an extremely mature production-quality database which is used to store multi-petabyte datasets by some of the largest websites in the world. If you want to be ready for growth and don't want to get caught debugging someone else's database code, I would recommend not using Derby. I don't have any experience with SQLite, but I can't imagine it being much less reliable than Derby has been for us and still being as popular as it is.

In fact, we're in the process of porting to PostgreSQL now.

卖梦商人 2024-08-26 09:42:09

Derby 的性能仍然相对较慢,但是...无论您的 Java 应用程序在哪里,您的数据库服务器都会在哪里,完全独立于平台。您甚至不需要考虑安装要将 Java 应用程序复制到的数据库服务器。

我将 MySQL 与 Java 结合使用,但是在我的 Java 应用程序中嵌入数据库服务器的实现是令人惊叹的、前所未有的生产力、自由度和灵活性。

随时随地在任何平台上始终拥有一个数据库服务器对我来说就是天堂!

Derby still is relatively slow in performance, but ... where ever your Java application goes your database server goes, completely platform independent. You don't even need to think about installing a DB server where your Java app is being copied to.

I was using MySQL with Java, but having an embedded implementation of your Database server sitting right within my Java App is just stunning and unprecedented productivity, freedom and flexibility.

Always having a DB server included whenever and wherever on any platform for me is just heaven !!!

虫児飞 2024-08-26 09:42:09

还没有直接将 Postgresql 与 Derby 进行比较。然而,在不同情况下使用过这两种方法后,我发现 Derby 非常可靠。但是,您需要注意 Derby 配置以确保它适合您的应用程序需求。

Have not compared Postgresql to Derby directly. However, having used both in different circumstances, I have found Derby to be highly reliable. However you will need to pay attention to Derby configuration to ensure it suits your application needs.

小耗子 2024-08-26 09:42:09

当查看 H2 数据库统计网站时,值得阅读后续讨论,与 H2 结论相比,该讨论有利于德比。 http://groups.google.com/group/h2 -database/browse_thread/thread/55a7558563248148?pli=1

When looking at the H2 databases stats site, it's worth reading follow up discussion which comes out in favour of Derby compared to the H2 conclusions. http://groups.google.com/group/h2-database/browse_thread/thread/55a7558563248148?pli=1

药祭#氼 2024-08-26 09:42:09

H2 数据库网站的一些统计数据如下:
http://www.h2database.com/html/performance.html

Some stats from the H2 database site here:
http://www.h2database.com/html/performance.html

唔猫 2024-08-26 09:42:09

有许多性能测试套件作为 Derby 源代码发行版本身的一部分包含在内; Derby 开发人员使用它们来进行自己的 Derby 性能测试。因此,如果您需要性能测试的示例,或者想要其他示例,您可以考虑使用它们。查看 Derby 源代码发行版中名为 java/testing/org/apache/derbyTesting/perf 的子目录。

There are a number of performance test suites that are included as part of the Derby source code distribution itself; they are used by Derby developers to conduct their own performance testing of Derby. So if you need examples of performance tests, or want additional ones, you could consider using those. Look in the subdirectory named java/testing/org/apache/derbyTesting/perf in the Derby source distribution.

∞觅青森が 2024-08-26 09:42:09

我不确定您所说的嵌入 Derby 是什么意思。当然这是一个选项,但您也可以将其安装为单独的服务器。

I'm not sure what you mean that Derby is embedded. Certainly that is an option, but you can also install it as a separate server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文