SlightlyLoony
Tera Contributor

find_real_file.pngIf you've done any scripting to customize your Service-now instance, you've probably run into a system identifier (sys_id) or two — those funny-looking values like "46e2fee9a9fe19810049b49dee0daf58". That's a unique 128-bit number expressed in hexadecimal, otherwise known as a GUID (and I'm not talking about the Guid Sisters!). If I'm speaking gobbledegook, read on for an explanation...

The basic notion behind a sys_id is simple: to assign a unique number to each record in a database table. This unique number provides a relatively short, consistent, and (most importantly) unambiguous key to find a particular record. Consider a table full of user names. If you didn't have a sys_id field, you might think of using a combination of first name plus last name as the key to find a particular record. You'll run into trouble as soon as you have two users named "John Smith" or "Mary Jones". By using a sys_id in every table, we can guarantee that every table has a valid unique key. Furthermore, every table uses the exact same mechanism — simple, reliable, and easy to understand.

Ok, but why isn't a sys_id a number, like 12,546,324? Why the funny-looking values?

Those funny-looking values are numbers, just expressed in hexadecimal. We chose hexadecimal because it's a compact way to represent a big number (and also because programmers are weird folks who think things like that are cool!).

The notion of using a 128 bit number as a unique identifier is a kind of informal standard, known as a Globally Unique IDentifier (or GUID). There are actually several formal standards for creating GUIDs, and there are variations tweaked for particular uses. In Service-now's case, GUIDs are generated by using instance-specific information, task-specific information, the time at the instant the GUID was generated, and a randomly assigned value.

How do you pronounce GUID? If you're not a geek, you likely have no idea what sort of silly, pointless war you're getting into with that question. So far as I can tell, the world is divided almost 50/50 between those genetically inferior sorts who pronounce it "GOO-id", and those who correctly pronounce it "gwid". Take your pick!

How big a number are these 128 bit GUIDs? Could we run out of system identifiers? Er...not likely. A 128 bit number holds 2^128 possible values, or about 3.4 x 10^38. That's 3.4 followed by 37 zeros — a really big number. If we generated a trillion system identifiers per second, we could generate them for 10 million trillion years before we ran out. We're probably safe...