Rupert Clayton commented on Feb 16, 2009

Consider expected replication interval when setting $UpdatedBy and $Revisions limits

Contrary to the advice in the main wiki article, it can be useful to set different limits for $UpdatedBy and $Revisions, particularly given that the fields will not necessarily remain in sync.

Each entry in $Revisions takes 8 bytes. However, each entry in $UpdatedBy must store a canonical Notes name and can therefore require much more storage space, maybe 40 bytes or more.

In contrast, succesive edits by the same person keep adding to the size of $Revisions but don't change $UpdatedBy.

The key consideration is to maintain enough data in $Revisions to cover the expected number of document modifications between one replication and the next. This is because Notes and Domino use this data to decide whether two documents can be merged, and which version of a field's data should win. If the $Revisions history does not stretch back far enough, Notes and Domino will be forced to create a replication conflict.

In calculating a limit for $Revisions, take into account all the revisions you might expect to happen via the user interface, from agents, via events on other forms, API code and through enterprise integration products.

You will need to balance the improved performance that may come from reducing the size of $Revisions against the potential need to manually resolve replication conflicts.

It's not clear whether to avoid replication conflicts there's a need to maintain a similar length of history in the $UpdatedBy field. Good practice would suggest again maintaining enough entries in here to cover the expected changes between one replication and the next.

Rupert Clayton commented on Feb 16, 2009

No guaranteed sync between $UpdatedBy and $Revisions

Unfortunately, the link between $Revisions and $UpdatedBy is not as simple as might be expected.

$Revisions is updated each time the document is saved, do on most documents you should expect there to be one fewer entries in $Revisions than the document-level sequence number. The last entry in $Revisions is the date and time of the penultimate edit (the most recent edit date and time is shown separately as the document's "Modified" date).

There is a default limit of 500 entries in the $Revisions field, and this limit can be adjusted through the advanced database property Limit size of $Revisions field.

The logic for the $UpdatedBy field is a little different, however. If a document is modified by the same ID as was last used to edit it, Notes and Domino do not add an entry to the $UpdatedBy field. You can demonstrate this as follows:

1. Adding a document to any database and save it.

2. Edit the document, and resave it.

3. Examine the contents of the $Revisions and $UpdatedBy fields through the Application Properties field browser. Both should have one entry (and the doc sequence number should be 2).

4. Edit the document again, and resave it.

5. Examine the field contents again. $Revisions will have two entries, the doc sequence number will be 3, but $UpdatedBy will still just contain one instance of your name.

More information would be helpful on the behavior of both fields when the document has the $ConflictAction flag set to 1.