Author Topic: Unique ID format  (Read 1145 times)

Nils Engerby

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Unique ID format
« on: May 31, 2024, 06:39:50 AM »
Does anyone happen to know how the Unique ID values are generated by CMOD? Do they conform to any of the defined UUID versions?
We are looking into ways to create UUIDs for old documents without export/reload and it seems to be good practice to use a timestamp-first format.
Nils Engerby - Skandia Bank & Insurance, Stockholm, Sweden
CMOD MP 10.5.0.7 - Windows Server 2022 - DB2 11.5.9 - SP Server 8.1.21
#Multiplatforms #Windows #ODWEK #AFP2PDF #DB2 #TSM

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2234
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Unique ID format
« Reply #1 on: May 31, 2024, 08:46:55 AM »
Hi Nils.

It's not documented, but I believe it's a 64-bit random number represented as hexadecimal that just has dashes inserted in arbitrary places.

This is different than Hash values, which are SHA-256 hashes based on the contents of the documents.

Since the change you're suggesting will make alterations to DB2 database tables, you absolutely MUST test your solution thoroughly in non-prod regions.  :)

A more supported way to do it would be to extract and load the old data into a new App Group that has the UUID configuration.

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

Nils Engerby

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Unique ID format
« Reply #2 on: June 05, 2024, 08:08:20 AM »
Thanks Justin,

Sorry to correct you but UUIDs are 128-bit and the dashes are in very specific positions. :) Nicely described on Wikipedia: https://en.wikipedia.org/wiki/Universally_unique_identifier

After testing the export/reload approach on some 100 thousand documents it is quite clear that the CMOD generated UUIDs are version 4 (random), indicated by the number "4" in the first position of the third group (xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx). Version 7 would probably have been a better choice to improve the database indexes. Or you could by all means identify it as version 4 and still use a combination of timestamp and randomness, which is what we have done in our UDF tests to update existing data.

Oh well, it's never easy, is it? Heads or tails ... :-\
//Nils
Nils Engerby - Skandia Bank & Insurance, Stockholm, Sweden
CMOD MP 10.5.0.7 - Windows Server 2022 - DB2 11.5.9 - SP Server 8.1.21
#Multiplatforms #Windows #ODWEK #AFP2PDF #DB2 #TSM

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2234
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Unique ID format
« Reply #3 on: June 05, 2024, 03:31:50 PM »
Please correct me without hesitation!  I didn't know that UUIDs followed specific standards, and I'm happy to learn about it.  :)

-JD.

IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

Nils Engerby

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Unique ID format
« Reply #4 on: June 09, 2024, 11:50:39 PM »
I can also add that I ran a count of the first two bytes of the CMOD generated ids and, not surprisingly, all 256 possible values between 00 and ff were represented with a fairly even distribution.
//Nils
Nils Engerby - Skandia Bank & Insurance, Stockholm, Sweden
CMOD MP 10.5.0.7 - Windows Server 2022 - DB2 11.5.9 - SP Server 8.1.21
#Multiplatforms #Windows #ODWEK #AFP2PDF #DB2 #TSM

rjrussel

  • Full Member
  • ***
  • Posts: 146
    • View Profile
Re: Unique ID format
« Reply #5 on: June 10, 2024, 07:07:44 AM »
Version 7 UUIDS weren't a thing when the feature was added to CMOD.

Thanks Justin,

Sorry to correct you but UUIDs are 128-bit and the dashes are in very specific positions. :) Nicely described on Wikipedia: https://en.wikipedia.org/wiki/Universally_unique_identifier

After testing the export/reload approach on some 100 thousand documents it is quite clear that the CMOD generated UUIDs are version 4 (random), indicated by the number "4" in the first position of the third group (xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx). Version 7 would probably have been a better choice to improve the database indexes. Or you could by all means identify it as version 4 and still use a combination of timestamp and randomness, which is what we have done in our UDF tests to update existing data.

Oh well, it's never easy, is it? Heads or tails ... :-\
//Nils

Nils Engerby

  • Jr. Member
  • **
  • Posts: 21
    • View Profile
Re: Unique ID format
« Reply #6 on: June 14, 2024, 02:43:58 AM »
Thanks Rob, I realize that. Way back in 2017. Time flies ...

We'll submit this as a possible improvement. The version number is in a fixed position so different versions could co-exist in most cases. Or it could be a selectable choice which version to use, system wide or per application group.

Version 7 UUIDS weren't a thing when the feature was added to CMOD.
Nils Engerby - Skandia Bank & Insurance, Stockholm, Sweden
CMOD MP 10.5.0.7 - Windows Server 2022 - DB2 11.5.9 - SP Server 8.1.21
#Multiplatforms #Windows #ODWEK #AFP2PDF #DB2 #TSM