UUID: where it is used
Practical use
Primary keys in distributed systems, order and session identifiers, file and upload names, request idempotency keys, trace IDs for logging and debugging integrations.
Batch generation is handy when you need to prepare a set of identifiers in advance for data import or test records.
Characteristics
A UUID takes more space than an auto-increment integer and orders worse — this is worth considering for high-load indexes (there are ordered variants like UUIDv7).
Do not use a UUID as a secret: it is unique but is not a random password or an access token.