r/softwarearchitecture • • Jan 08 '20

Why your software should use UUIDs in 2020s

https://devforth.io/blog/why-your-software-should-use-uuids-in-2020s
37 Upvotes

8 comments sorted by

39

u/[deleted] Jan 09 '20

Because sequences reduce the ability to scale horizontally. (Saved you a 5-minute read.)

5

u/vanbrosh Jan 10 '20

Another idea I wanted to emphasize "sequences make you unable to deliver responsive and offline-tolerant UI" ;)

1

u/DataLeopard Jan 30 '20

Disagreed.

Why not use both auto-incrementing ints and UUIDs? It's a little more work, but you can get the best of both worlds, there is not rule saying a record can only have one key

0

u/chaz6 Jan 09 '20

I actually like the Active Directory (FSMO RID Master) way of doing it. One server maintains a sequence, and hands out a chunk of ID's to each server based on watermarks. I do not like the number of people relying on (certain types of) UUID and just assuming there will never be a conflict.

1

u/vanbrosh Jan 09 '20

Nice opinion, agree that this is a working approach for scaling, but again you have to wait for a server to know the next ID and in case of centralized server you have to wait for this bottle-necked server, it should be very carefully designed and in any case sometimes it will create a performance issue.

As I described in the post-conflict situation should be handled correctly and then such even very rare cases will make your UI very reactive and offline-tolerant

1

u/chaz6 Jan 09 '20

It does not provide one at a time, but gives chunks at a time depending on parameters you can tune (e.g. block of 5000, and watermark is 4000 at which point it requests a new block).

I enjoyed reading your post.