Identifiers
Identifiers, or IDs for short, are unique values that are used to identify a specific resource in the real world and/or in an IT system.
This document discusses different types of identifiers. What business identifiers are used on the resources are detailed in the documentation for the specific resources.
Surrogate vs natural keys
A common way to classify different identifiers (at least in database design) is to call them "natural" and "surrogate" keys.
A natural key is a key that is derived from the data itself. For example, a person's social security number is a natural key for a person. A surrogate key is a key that is generated by the system, and has no meaning outside of the system. For example, a UUID or incremental identifiers is a surrogate key.
Multiple identifiers
It is common for a resource to have multiple identifiers. A metering point might have a metering point ID (GSRN), an internal incremental integer ID in the system and an external-facing UUID. Sometimes it is also useful to store an external systems reference to the same logical/business object.
Multiple types of identifiers
It is sometimes useful to allow multiple types of identifiers for a resource. A relevant example could be to allow the use of both GLN and EIC-X for parties. In such scenarios, it might be wise to include a type field as part of the identifier.
Example:
{
"business_id_type": "GLN",
"business_id": "0847976000005"
}
Resource identifiers - Incremental integers
All resources are primarily identified by an incremental integer in the API and system. See the API documentation for more information.
Identifier types
There are lots of different types of identifiers. This section outlines relevant ones for a Norwegian Flexibility Information System.
GS1 Standards - GLN, GSRN et.al
GS1 has quite a few different identifiers. They are typically prefixed with a country and business identifiers. Notable mentions are:
- Global Location Number (GLN) - 13 digits - used for identifying parties.
Example:
0847976000005 - Global Service Relation Number (GSRN) - 18 digits - used for identifying
metering point. Example:
012345678901234560 - GIAI (Global Individual Asset Identifier) - 30 alphanumeric characters - used for identifying meters.
Core benefits of using GLN and GSRN is that they are globally unique (ensured by GS1) and human-friendly since they include a check digit (no typos!).
Energy Identification Codes (EIC)
EIC is maintained by ENTSO-E and can be used to identify market participants, areas, measuring points, resource objects, tie-lines, location and substations.
It's 16 alphanumeric characters including issuing office, type and check digit. Used for grids (MGA, MBA) in imbalance settlement.
Example: 10X1001A1001A38Y
Universally Unique Identifier (UUID)
UUID provides globally unique
identifiers and has its own URN namespace urn:uuid. There are
many different versions.
Both v4 and v7 could be good choices for us.
Example: 55840dbe-0131-40ae-9077-e78b2a8c1455
Common Information Model (CIM) promotes the use of UUIDs as identifiers for the IdentifiedObject Master resource identifier (mRID).
Universally Unique Lexicographically Sortable Identifier (ULID)
ULID are kind of like UUIDs but they are shorter, case-insensitive, URL safe and sortable.
Example: 01ARZ3NDEKTSV4RRFFQ69G5FAV
Incremental integers
A very common way to generate identifiers in a system is go pick the next number from a sequence.
This is simple but only unique in the system that generates the identifier unless paired with a guaranteed unique prefix.
Example: 1212.