ADR: Separate modifyTime and modifyUser for every version of OSDU storage record

Separate modifyTime and modifyUser for every version of OSDU storage record

Status

  • Proposed
  • Trialing
  • Under review
  • Approved
  • Retired

Context & Scope

The concept is that one record should have 1 version of metadata. However, in regard to modifyUser and modifyTime attributes, they should be different for each version. Currently, the behaviors are as implemented, but the behavior by the above concept is wrong.

The original issue that was raised is here.

So with the current behavior, for multiple versions of the same record modifyTime and modifyUser value are same and they are overwritten to all versions during every modification made to the record.

Which means for records having only 1 version, it is like below.

version1
createUser
createTime

But when the record is modified and multiple versions are created, the metadata of the record for latest version is applied to all versions including the first version as well.

version1 version2 version3
createUser createUser createUser
createTime createTime createTime
modifyUser2 modifyUser2 modifyUser2
modifyTime2 modifyTime2 modifyTime2

Due to this behavior, the record modification history is lost and which versions of the record are created by which users cannot be tracked.

Tradeoff Analysis

The metadata; which contains modifyUser, modifyTime attributes; will be stored separately against every record version. This means the metadata stored for storage records will increase.

The record modification history can be tracked and which users created different versions of the record can be traced, which was not possible before.

Decision

Version 1 should only have createUser and createTime. modifyUser and modifyTime should not exist in the first version.

Version 2+ should have different modifyUser and modifyTime for each version.

version1 version2 version3
createUser createUser createUser
createTime createTime createTime
modifyUser1 modifyUser2
modifyTime1 modifyTime2

If the record meta-data (i.e. tags, legal tags and ACLs blocks from the record) is modified using storage PATCH API, version number is not changed and only the latest value for modifyUser and modifyTime will be maintained against that record version.

Consequences

  • Storage service behavior will change.
  • Storage service documentation needs to be updated.
Edited by Chad Leong