Home

MS Base

  • prefix: ms:
  • schema: b:

Categories (Data):

Categories (Governance):

units:

 
 

Schema element "b:revision"

The revision of a b:unit is used to determine whether the unit has changed. Only the newest revision should be kept: the older MUST be removed immediately. String order determines age order.

Definitions

<element name="revision">
  <simpleType>
    <restriction base="string">
      <pattern value="[A-Za-z0-9_;,.=#{}&lt;&gt;&quot;'-]+" />
    </restriction>
  </simpleType>
</element>

Description

Revisions are subtlety different from versions. where in your mind you may have a (software) version-for-test and a version-for-production, this really is not the purpose of this field. Read the detailed explanation.

The name "revision" should make it clear that it is about the unit itself. The only valid unit, is the one with the highest revision.

It is very well possible that multiple revisions of the same unit exist on different servers. However, within hours the replication features of the Unit collections will have replaced the old revisions.

Comparing UTF-8 is really hard, unless you restrict the characters to the ASCII namespace. Therefore the character restriction.

Discussion

Convenient revision schemes

You have many options. Remember: the only limitation is that the ASCII sort order MUST be the sequential age order. Examples:

  • A simple counter with suffient leading zeros: 000001, 000002, 000003, ...;
  • Seconds since epoch in 10 digits: 023429080, 1621254002, ...;
  • Formatted time: 2020-01-01T12:34:00.123, 2021-05-17T01:01:01, ...;
  • DNS SOA Serial style: 2021051701, 2021051702, 2021051801, ...; or
  • Some database generated serial sequential id

Formatted date-time looks nice, but converting date to string is relatively expensive. It may also lead to collisions when produced on compute nodes in parallel and time-zones. Keep it simple.


mark@overmeer.net      Web-pages generated on 2023-12-19