Skip to main content

Questions tagged [uuid]

6 votes
3 answers
2k views

How to handle primary keys and UUIDs in a database

I've heard advice from several people about using UUIDs as ID in your database. For one this has the benefit of making your URLs unguessable. It also masks how many objects you have in the system. e.g....
StaticMethod's user avatar
13 votes
6 answers
10k views

Why use a special "Name" class (instead of just a string) for representing object names in C++?

Suppose we have an Instance class in a C++ program, which has a GUID/UUID, name, parents, children, and other properties which can be saved to or loaded from an XML file. The intuitive approach for ...
Bunabyte's user avatar
  • 643
6 votes
4 answers
2k views

Protecting against malicious duplicate IDs in a distributed environment

Let's say we have multiple (somewhat autonomous) (micro-)services, and when entities are created, the ID (UUIDs or whatever) can be set externally. How can we ensure that an ID remains unique across ...
Philippe's user avatar
1 vote
2 answers
413 views

High-cardinality UUID: how/where to store? [closed]

I have lots of devices, each identified by a unique UUID. For each device, I have one or more timeseries data (potentially up to millions of entries). What's the best way to store these entries? ...
persson's user avatar
  • 197
2 votes
3 answers
2k views

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 ...
RyanCosans's user avatar
1 vote
3 answers
1k views

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 ...
Mointy's user avatar
  • 119
1 vote
4 answers
2k views

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 ...
Joan Venge's user avatar
  • 1,970
-2 votes
2 answers
15k views

What is the minimum length for a UUID?

From general observation I've come across the standard to be 36. I was looking to incorporate a uuid in my urls but didn't want it that long. Is there a minimum where I can still keep the uuid unique?
Carl Edwards's user avatar
3 votes
2 answers
3k views

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 ...
pik4's user avatar
  • 385
2 votes
1 answer
604 views

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. ...
Oleg Mikheev's user avatar
0 votes
2 answers
443 views

Questioning the impact of UUIDs

When I first played with a NoSQL database I become aware of the impact of UUIDs in a distributed system. MongoDB defaults to ObjectIDs, but I've always questioned in which cases UUID (RFC4122) would ...
SystematicFrank's user avatar
2 votes
1 answer
2k views

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 ...
designermonkey's user avatar
-2 votes
1 answer
650 views

Repository UUID equivalent

I am converting an old Subversion repository to Git. Here is an example: $ svn info http://alfa.com/bravo/charlie Path: charlie URL: http://alfa.com/bravo/charlie Relative URL: ^/charlie Repository ...
Zombo's user avatar
  • 1
4 votes
3 answers
7k views

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 ...
KaareZ's user avatar
  • 151
7 votes
1 answer
5k views

Uniformly distributing GUIDS to bucket of size N [closed]

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 ...
FaisalMansoor's user avatar

15 30 50 per page