现实生活中的 ZODB
使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我已经在 Zope 内外使用 ZODB 十多年了。如果您的数据是分层的,那就太好了。客户可能拥有最大的数据存储。不知道,有100GB吗?无论如何,在这个数量级上。
这是与 Postgres 的性能比较。
如果您正在编写 WSGI Web 应用程序,这些包可能有用:
repoze.tm2 (文档)
repoze。 zodbconn (文档)
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:
repoze.tm2 (docs)
repoze.zodbconn (docs)
与“任何键值存储”相比,ZODB 的关键功能是将属性更改与真正的 ACID 事务自动集成,以及对其他持久对象的干净、“任意”引用。
ZODB 比 Zope 默认使用的 FileStorage 更大:
总的来说,我很高兴使用 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:
Overall, I'm very happy using ZODB for nearly any problem where the shape of the data is not obviously "square".
我会推荐它。
我真的没有任何批评。如果您正在寻找一个对象存储,那么就可以使用它。我之前在里面存放过 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.
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.
通过酸洗,您应该能够使用任何 密钥value 数据库以类似的方式。
With pickling you should be able to use any key value database in a similar fashion.