[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Add-if-not-present



> Do you have a use case for this?  I'm implementing add-if-not-present to
> ease the implementation of the version number overlay, so I could
> implement softdel as well.
> 
> I think all of these could make sense also protocol-wise (including
> softadd), but I'm not in the mood right now to start the formalization
> process, so I'd leave it to a later time.

Yes.  I've had to implement this exact feature in application code before (via search + conditional mod).  It appears frequently in middleware stuff when you're merging data from multiple upstream account sources and a registry into LDAP.  The softdel case appears less often than softadd, but is extremely useful when trying to cleanup mistakes.

More concretely, middleware performing a multi-db reconciliation sweep can use it to assert implied constraints on each object.  For example, if some event happens, the entry must now have attr1=val1, and must not have attr2=val2, but might already be in that situation.  This allows for more cases of idempotent atomic changes without needing transactions.

A number of overlays will need to watch for this as it is particularly relevant for groups (memberOf, refint, etc).

Matthew Backes
Symas Corporation
mbackes@symas.com