Or one, depending on how often your data changes and how big it is. All about how ZODB stores this information.
Saving data directly from an object using setattr means that the data is stored in a permanent record for this object. If it is a large object, which means that there will be a large transaction for the record.
Storing data in zope.annotations annotation means that you get a separate persistent record for each annotation record, so any changes to your data will result in a smaller transaction. But if you want to access this data often, you need to add an additional persistent record on top of all other persistent records. This will take up a slot in your ZODB cache, your ZEO server or RelStorage server will need to serve it, etc.
plone.uuid uses setattr because it is usually generated only once for a given object, usually at a time when it is already created. This is also part of the data that is accessed frequently and quite a bit. Thus, placing it directly on the object, it will be loaded as soon as you load this object, no additional disconnections to the ZODB will be required, and it will be changed only once on it.
Note: from the foregoing, it is assumed that annotations are stored with the AttributeAnnotations adapter, which is the most common method and default for Plone content.
source share