
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2020 04:30 AM
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?
Solved! Go to Solution.
- Labels:
-
Platform and Cloud Security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-03-2020 04:40 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2021 01:25 PM
The sys_id is not 32 digits, its 32 characters according to dictionary. And is twice as big as it needs to be. It is not a properly formatted GUID. The service now GUID can store 255^^32 or 1.02E77 unique values. A properly defined GUID only needs 16 bytes and can accommodate 2^^128 or 3.4E38 unique values. An issue would occur if you were to try to transfer the data to a system that has a proper GUID.