Sounds like a good id :p
Welcome to DevRant! May you transcend Green-Dotness soon
netikras2404717dYou can use another guid as a naturalId.
Although it all depends on you boss'es reasoning
Excellent first post!
Even amazon only uses base34 numbers in a 4 char sequence on boxes for packages. Internally it's still UUID bc fast.
Hopefully your boss had a good reason for all the extra engineering effort >.<
@SortOfTested likely they are using base34 because of the O and I colliding with 0 and 1 issue. But then, 4 letters in base34 only sums up to 1.3 million, feels like there is more to it as Amazon definitely handles more than that in a day....
The reasoning for the extra dev work is mentioned above and so yeah (well at least I get to spend some good time on maths while still doing work)
@SortOfTested got it. earlier while thinking of the structure, we've also discussed about whether to have a single unique id (easier for customer support), or to have repeatable id (per day or until it finishes and repeat again, but then customer support would need to ask more info and so we scrapped that idea)
netikras2404717d@wcypierre still doesn't answer WHY. Security concerns? Easy -- just use unique IDs in user-scope, i.e. each user can have IDs in a range [0, Long.MAX_VALUE]. This way my first order will be #1, second -- #2, etc. Your first order will be #1, second - #2, etc. And we can refer to order #1 and we'll only be navigating in our user's scope - no way to access any other user's orders.
ofc the backend has to do the user_id+order_id=>PK(GUID) mapping, but that's a negligible overhead.
If entities are to be shared among users [i.e. not possible to scope per-user], you can use slugs of their textual representation. Although I guess that might be somewhat guessable, but then any ID is. The slug value is clear when read - you can also append some random number to the end to increase probability of uniqueness (you can encure random+slug uniqueness upon persistance).
But since IDK your use-case it's difficult to drop anything fitting your bill well enough :)
but "uuid is too complex" is weird...