logoalt Hacker News

tossandthrow • today at 7:47 AM • 1 reply • view on HN

I have had this conversation with the team. I lead, who started to use properties of the ID for ordering etc.

An ID is an identifiers. It supports exactly the operation of comparing two IDs to establish identity.

When you start to treat them as something else that is not guaranteed, you will see weird things happening.


Replies

Xirdus • today at 7:58 AM

You can encode extra things in IDs no problem. E.g. Polish civil records system uses PESEL numbers which, on top of being unique IDs, also encode date of birth and gender.

As long as you have absolute control over every single ID generated, it will work just fine. The problem is that it's way too easy to accidentally generate UUID in a way that ignores whatever rules you set up for it. Also, clocks are hard.