Skip to content
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

Consider using RNG to generate the Id value instead of Guid #7

Open
benfoster opened this issue Oct 10, 2022 · 2 comments
Open

Consider using RNG to generate the Id value instead of Guid #7

benfoster opened this issue Oct 10, 2022 · 2 comments

Comments

@benfoster
Copy link
Owner

benfoster commented Oct 10, 2022

Since the value of the underlying Guid is never exposed, we could consider using a Random Number Generator to generate the Id value. This would also have the benefit of being stronger cryptographically and more random though may influence performance negatively.

@benfoster
Copy link
Owner Author

@khellang keen to hear your thoughts on this one

@khellang
Copy link
Contributor

The reason Guid was used in the first place, is that the original code was just a Base32 encoding/decoding of existing Guid in storage/memory. After introducing a separate data type, I don't see a need to rely on Guid anymore.

I'm not sure 100% random is the best trade-off, though. What about index fragmentation (sequential guids?) or sortability (ULID?). Once you've freed yourself from the shackles of UUIDv4, I think you need to consider these trade-offs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants