5 ms·
For some things there's no obvious unique identifier other than a something random. Out of curiosity, do you maintain separate IDs, one internal and one extern
by MikeNotThePope 1y ago
For some things there's no obvious unique identifier other than a something random. Out of curiosity, do you maintain separate IDs, one internal and one external?
- abujazar 1y agoYea, I usually keep a simple incremental ID or whatever is default for internal IDs, and a separate external ID for entities that are presented externally. For security and not unnecessarily leaking info about the number of records, time and rate of record creation etc. UUIDv4 is convenient for uniqueness, but impractical if the ID needs to be conveyed over phone or written down – or used in URLs, so I often use some system for slugs or short codes in addition to the UUID.