Questions tagged [uuid]
20 questions
50
votes
3 answers
Strategy for generating unique and secure identifiers for use in a "sometimes offline" web app
I have a web based project that allows users to work both online and offline and I'm looking for a way to generate unique ids for records on the client side. I'd like an approach that works while a user is offline (i.e. unable to talk to a server),…

herbrandson
- 611
- 1
- 6
- 7
33
votes
6 answers
UUID collisions
Has anybody done any real research on the probability of UUID collisions, especially with version 4 (random) UUIDs, given that the random number generators we use aren't truly random and that we might have dozens or hundreds of identical machines…

Paul Tomblin
- 1,949
- 1
- 15
- 19
25
votes
7 answers
How to generate "language-safe" UUIDs?
I always wanted to use randomly generated strings for my resources' IDs, so I could have shorter URLs like this: /user/4jz0k1
But I never did, because I was worried about the random string generation creating actual words, eg: /user/f*cker. This…

HappyDeveloper
- 902
- 1
- 8
- 11
18
votes
2 answers
Why are UUID / GUID's in the format they are?
Globally Unique Identifiers (GUID) are a grouped string with a specific format which I assume has a security reason.
A GUID is most commonly written in text as a sequence of hexadecimal
digits separated into five groups, such…

Xeoncross
- 1,213
- 1
- 11
- 24
10
votes
8 answers
A good schema to represent integer numbers from 0 to infinity, assuming you have infinite linear binary storage?
I would like a schema to represent integer numbers starting with 0, without any limit (assuming access to infinite linear storage).
Here's a schema that can represent numbers from 0 to 255:
Use the first byte of the storage (address 0) to store the…

Dmitri Shuralyov
- 327
- 2
- 10
7
votes
1 answer
Uniformly distributing GUIDS to bucket of size N
How can uniformly and deterministically distribute set of GUIDS to N buckets.
N can be as small as 2.
Need to make sure the same GUID is always mapped to the same bucket.
Can't use any additionally memory.
Input GUID set is not known in advance,…

FaisalMansoor
- 181
- 1
- 5
4
votes
3 answers
UUID vs Integer
For a database. Should I use an UUID or an integer for the primary key?
I will never exceed 2^32 in amount of rows, so an integer should be more than plenty.
I would prefer to use an integer, as I find it easier to work with, especially when using…

KaareZ
- 151
- 1
- 7
3
votes
2 answers
Generate UUID in Application or Database level?
I created a new application and I am thinking where is the best place to generate a UUID.
Generate a UUID in application level and persist it
Generate a UUID in Database level
I have a feeling that is a better approach to generate the UUID in…

pik4
- 365
- 3
- 13
3
votes
2 answers
Accepting the UUID collision risk based on number of clients
After reading some questions about the probability of UUID collisions it seems like collisions although unlikely, are still possible and a conflict solution is still needed. Therefore I am wondering about the background of choosing UUIDs for…

SystematicFrank
- 897
- 8
- 18
2
votes
3 answers
Should you manually generate UUIDs / GUIDs by modifying an existing UUID / GUID?
As an example imagine I generate a UUID/GUID for an ID in a json file.
{
"25d01302-2558-4c44-bf9d-385b1cc51377": ["somevalues"]
}
is it ok or generally frowned upon to do something like
{
"25d01302-2558-4c44-bf9d-385b1cc51377": ["somevalue"],
…

RyanCosans
- 209
- 1
- 7
2
votes
1 answer
MySQL UUID storage/presentation
I'm looking at the way UUIDs are stored in MySQL. MySQL 8 still doesn't have a UUID data type, and it still doesn't have custom types, so there are two options - store it as a string or as a binary.
Binary form saves 30% of space and performs much…

Oleg Mikheev
- 131
- 5
2
votes
1 answer
How do I create Uuids in DDD Entities/Aggregates
As I am learning DDD to help build an app idea the proper way ;) I have come across a confusing aspect that I am trying to find a solution for.
I understand the need for Uuids in an app the size of which I am creating, but I am a little lost as to…

designermonkey
- 383
- 4
- 11
2
votes
2 answers
Is it okay if we use an arbitrary string as UUID?
I found the tutorial of client (android) and server (pc) bluetooth tutorial from here.
But my question is about the UUID.
Is that okay if we define it randomly without the proper format? Because I heard UUID is generally for ID for each devices…

gumuruh
- 123
- 6
1
vote
3 answers
Better than ongoing integer and uuid as primary key
I read a lot about using ongoing numbers vs UUIDs as the primary key and had an idea how it might be possible to combine both and profit from their advantages, without their disadvantages.
The table would have an id column that is auto-incremented…

Mointy
- 119
- 4
1
vote
4 answers
Is using multiple UUIDs decrease chance of collisions exponentially?
For example if you have a single UUID with a collision probability of x, if you concatenate 2 UUIDs, does the collision probability become x^2?
val0 = generate_uuid()
val1 = generate_uuid()
final_val = val0 + val1
So with each additional uuid,…

Joan Venge
- 1,950
- 2
- 18
- 24