-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uuid in doubt #102
Comments
It may indeed be worthwhile to amend this one slightly, even if only to make it clear that it's certainly not a slam dunk to use UUIDs. The way I see it, UUID advantages:
Sequence/serial advantages:
|
Good callouts. Do you think we should move from a recommendation to an explanation of the tradeoffs then? |
It's worth mentioning that UUIDs also bring security benefits. An online store may leak information about their sales numbers if they expose integer IDs for their order numbers, allowing competitors to monitor their activity. Malicious actors may also use them to enumerate/scrape resources which may not be desirable. I'd personally recommend UUIDs over integers unless you expect to never expose these ids or have a good reason to use them. EDIT 2024/09/16: UUIDs also match integers' data locality improvements if you use v7 UUIDs, which sort by the date when they were created. |
I'd welcome a PR if you'd like to draft some updates. |
As mentioned in the gitbook, Returning response with uuid is a better practice. But backend developer usually use database to store data.As we know,It is not recommended to use uuid in the database,So how to solve the problem or haveing good suggestion.
The text was updated successfully, but these errors were encountered: