现实生活中的 ZODB

发布于 2024-08-23 18:56:21 字数 232 浏览 7 评论 0原文

使用 Python 编写应用程序,并尝试各种 ORM 设置和直接 SQL。所有这些都像罪恶一样丑陋。

我一直将 ZODB 视为一种对象存储,它看起来是一个很有前途的替代方案......您会推荐它吗?您的经验、问题和批评是什么,特别是关于开发人员的观点、可扩展性、完整性、长期维护和替代方案?有人用它开始一个项目然后放弃它吗?为什么?

虽然 ZODB、Pypersyst 等背后的想法很有趣,但人们似乎对它们缺乏热情:(

Writing an app in Python, and been playing with various ORM setups and straight SQL. All of which are ugly as sin.

I have been looking at ZODB as an object store, and it looks a promising alternative... would you recommend it? What are your experiences, problems, and criticism, particularly regarding developer's perspectives, scalability, integrity, long-term maintenance and alternatives? Anyone start a project with it and ditch it? Why?

Whilst the ideas behind ZODB, Pypersyst and others are interesting, there seems to be a lack of enthusiasm around for them :(

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

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

发布评论

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

评论(5

蓝梦月影 2024-08-30 18:56:21

我已经在 Zope 内外使用 ZODB 十多年了。如果您的数据是分层的,那就太好了。客户可能拥有最大的数据存储。不知道,有100GB吗?无论如何,在这个数量级上。

这是与 Postgres 的性能比较

如果您正在编写 WSGI Web 应用程序,这些包可能有用:

I've used ZODB for more than ten years now, in Zope and outside. It's great if your data is hierarchical. The largest data store a customer operates has maybe. I don't know, 100GB in it? Something on that order of magnitude anyway.

Here is a performance comparison against Postgres.

If you're writing a WSGI web app, these packages may be useful:

左秋 2024-08-30 18:56:21

与“任何键值存储”相比,ZODB 的关键功能是将属性更改与真正的 ACID 事务自动集成,以及对其他持久对象的干净、“任意”引用。

ZODB 比 Zope 默认使用的 FileStorage 更大:

  • RelStorage 后端允许您将数据放入 RDBMS 中,可以使用标准工具对其进行备份、复制等。
  • ZEO 允许轻松扩展应用程序服务器和离线作业。
  • 两阶段提交支持允许协调多个数据库之间的事务,包括 RDBMS(假设它们提供 TPC 感知层)。
  • 基于对象属性或包含的简单层次结构:您不需要编写递归自连接来模拟它。
  • 基于文件系统的 BLOB 支持使得提供大文件变得很容易实现。

总的来说,我很高兴使用 ZODB 来解决几乎所有数据形状不是明显“方形”的问题。

Compared to "any key-value store", the key features for ZODB would be automatic integration of attribute changes with real ACID transactions, and clean, "arbitrary" references to other persistent objects.

The ZODB is bigger than just the FileStorage used by default in Zope:

  • The RelStorage backend lets you put your data in an RDBMS which can be backed up, replicated, etc. using standard tools.
  • ZEO allows easy scaling of appservers and off-line jobs.
  • The two-phase commit support allows coordinating transactions among multiple databases, including RDBMSes (assuming that they provide a TPC-aware layer).
  • Easy hierarchy based on object attributes or containment: you don't need to write recursive self-joins to emulate it.
  • Filesystem-based BLOB support makes serving large files trivial to implement.

Overall, I'm very happy using ZODB for nearly any problem where the shape of the data is not obviously "square".

梦里的微风 2024-08-30 18:56:21

我会推荐它。

我真的没有任何批评。如果您正在寻找一个对象存储,那么就可以使用它。我之前在里面存放过 250 万件物品,并没有感觉到挤。

I would recommend it.

I really don't have any criticisms. If it's an object store your looking for, this is the one to use. I've stored 2.5 million objects in it before and didn't feel a pinch.

甩你一脸翔 2024-08-30 18:56:21

ZODB 已用于大量大型数据库

大多数 ZODB 使用可能是 Zope 用户,如果他们从 Zope 迁移,他们就会迁移出去

性能不如关系数据库 + ORM,尤其是在有大量写入的情况下。

长期维护还不错,您有时想打包数据库,但这可以实时完成。

如果您要对 ZODB 使用多个进程,则必须使用 ZEO,这比直接使用 ZODB 慢很多,

我不知道 ZODB 在闪存盘上的执行情况如何。

ZODB has been used for plenty of large databases

Most ZODB usage is/was probably Zope users who migrated away if they migrate away from Zope

Performance is not so good as relatonal database+ORM especially if you have lots of writes.

Long term maintenance is not so bad, you want to pack the database from time to time, but that can be done live.

You have to use ZEO if you are going to use more than one process with your ZODB which is quite a lot slower than using ZODB directly

I have no idea how ZODB performs on flash disks.

じ违心 2024-08-30 18:56:21

通过酸洗,您应该能够使用任何 密钥value 数据库以类似的方式。

With pickling you should be able to use any key value database in a similar fashion.

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