Why do sys_id have to be 32 digit and not more?

Anish Reghu
Kilo Sage
Kilo Sage

Why do the sys_id have to be 32 digit?

What made the platform architects come to a decision that 32 digit sys_id will be enough to make it globally unique?

1 ACCEPTED SOLUTION

Aniket Sawant
Mega Expert

Hi,

A unique 32-character long identifier that is the primary key for every record in every table of the Service-now.com database. You may even already be aware that every sys_id is an example of a GUID (Globally Unique IDentifier, pronounced either GOO-id or GWID). But do you know how a GUID is made, and what all its characters mean?

And do you know that not all sys_ids are created equally?

GUIDs are (usually) a sequence of 32 hexadecimal digits. Since each hexadecimal digit represents four bits, and 4 â‹… 32 = 128, that means that a standard GUID is actually a 128-bit number (roughly the same as a 1038, or 38 digits, decimal number). This number is generated at the moment any given record is first inserted. The 128 bits are built up from four separate 32-bit numbers, as follows:

  • The IP address of the instance's server (whichever node is inserting the record)
  • The GMT system time, to the nearest millisecond
  • A number derived from the GlideRecord (a hash of its properties)
  • A pseudo-random number


Each of these elements contributes to making each GUID unique.

Here's how sys_ids are not necessarily created equally: there are a few records in Service-now.com (all from the earliest days of the product) where the sys_ids were hand-crafted. A sys_id is just a string, and the only requirement is that they be unique within any given table, so this was possible to do. If you grub around the system enough, you might actually find one with someone's name as the sys_id!

 Please mark as Correct Answer and Helpful, if applicable.

Regards,

Aniket Sawant

 

View solution in original post

5 REPLIES 5

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi Anish,

here some reference to look:

https://docs.servicenow.com/bundle/newyork-platform-administration/page/administer/table-administrat...

https://community.servicenow.com/community?id=community_blog&sys_id=05cc2265dbd0dbc01dcaf3231f961918

The same sys_id value is never generated twice, which ensures that every record created in every table in every instance in the world has a unique identifier. If two records have the same sys_id value, then one was copied to the other at the database level outside of the Now Platform. When created within the application, sys_id values are unique

If I have answered your question, please mark my response as correct and/or helpful.

Thank you very much

Cheers
Alberto

Aniket Sawant
Mega Expert

Hi,

A unique 32-character long identifier that is the primary key for every record in every table of the Service-now.com database. You may even already be aware that every sys_id is an example of a GUID (Globally Unique IDentifier, pronounced either GOO-id or GWID). But do you know how a GUID is made, and what all its characters mean?

And do you know that not all sys_ids are created equally?

GUIDs are (usually) a sequence of 32 hexadecimal digits. Since each hexadecimal digit represents four bits, and 4 â‹… 32 = 128, that means that a standard GUID is actually a 128-bit number (roughly the same as a 1038, or 38 digits, decimal number). This number is generated at the moment any given record is first inserted. The 128 bits are built up from four separate 32-bit numbers, as follows:

  • The IP address of the instance's server (whichever node is inserting the record)
  • The GMT system time, to the nearest millisecond
  • A number derived from the GlideRecord (a hash of its properties)
  • A pseudo-random number


Each of these elements contributes to making each GUID unique.

Here's how sys_ids are not necessarily created equally: there are a few records in Service-now.com (all from the earliest days of the product) where the sys_ids were hand-crafted. A sys_id is just a string, and the only requirement is that they be unique within any given table, so this was possible to do. If you grub around the system enough, you might actually find one with someone's name as the sys_id!

 Please mark as Correct Answer and Helpful, if applicable.

Regards,

Aniket Sawant

 

A fantastic explanation. Thanks! Exactly what I wanted.

Tanushree Doiph
Mega Guru

Hi Anish,

The unique 32-character long identifier that is the primary key for every record in every table of the Service-now.com database. You may even already be aware that every sys_id is an example of a GUID (Globally Unique IDentifier, pronounced either GOO-id or GWID). But do you know how a GUID is made, and what all its characters mean?

And do you know that not all sys_ids are created equally?

GUIDs are (usually) a sequence of 32 hexadecimal digits. Since each hexadecimal digit represents four bits and 4 â‹… 32 = 128, that means that a standard GUID is actually a 128-bit number (roughly the same as 1038, or 38 digits, decimal number). This number is generated at the moment any given record is first inserted. The 128 bits are built up from four separate 32-bit numbers, as follows:

  • The IP address of the instance's server (whichever node is inserting the record)
  • The GMT system time, to the nearest millisecond
  • A number derived from the GlideRecord (a hash of its properties)
  • A pseudo-random number


Each of these elements contributes to making each GUID unique.

Here's how sys_ids are not necessarily created equally: there are a few records in Service-now.com (all from the earliest days of the product) where the sys_ids were hand-crafted. A sys_id is just a string, and the only requirement is that they be unique within any given table, so this was possible to do. If you grub around the system enough, you might actually find one with someone's name as the sys_id!

 

Please mark correct and helpful.

 

Thanks

Tanushree