Re: Should intids be replaced with uuids for relations?
Wichert Akkerman <[email protected]>
| Newsgroups | gmane.comp.web.zope.plone.devel |
|---|---|
| Message-ID | <[email protected]> |
On 06 Mar 2014, at 08:23, David Glick (Plone) <david.glick-z4DKO/[email protected]> wrote: > On 3/5/14, 10:57 PM, Asko Soukka wrote: >> Hi, >> >> during the last years there have been some controversy whether to use >> plone.app.relationfield for relations or just save UUIDs into fields and >> catalog them into portal_catalog. >> >> Since plone.app.contenttypes will use relationfields, that seems to be >> coming the official way. >> >> My only concern is that currently relations rely on intids, and we are >> not using them for anythin else (by default). >> >> Yet, it's not zc.relation (the relation catalog) which requires intids, >> but only z3c.relationfield se depend on. So, I'd guess, it should be >> possible to use uuids instead of intids by dropping z3c.relationfield >> (and all intid-packages) and implementing all required counterparts for >> zc.relation and z3c.form directly in plone.app.relationfield. >> >> Would you see issues with this? Is there some other relation roadmap, >> which I'm missing? >> > Using intids as the keys for catalog indexes is ideal and was done intentionally, because integers can be compared more quickly than strings, so IOBTrees are faster (at least, that's my understanding of why intids were used). This is also one reason the ZCatalog uses an integer rid (record id) internally instead of some other identifier. That argument does not quite make sense to me: a UUID is just a 128-bit digit number, so if you store that as an integer instead of a formatted string you should have exactly the same advantages. Wichert. ------------------------------------------------------------------------------ Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk