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

Should we consider using GUIDs rather than incrementing integers for primary keys? #156

Open
theninja opened this issue Nov 8, 2017 · 0 comments

Comments

@theninja
Copy link
Contributor

theninja commented Nov 8, 2017

I feel using GUIDs (partially sequential - MySQL 8+ seems to come with built-in support for these via UUID_TO_BIN) for our primary keys gives us some quite nice benefits. I'm thinking towards the future for scaling/replication and generating indexes on the front-end (possibly even in some kind of offline mode). I guess this would also make merging separate databases easy, which might be helpful for future migrations.

We would need to discuss some of the cons too, like disk usage (16 bytes rather than 4 for each key) and any performance costs (I've never used GUIDs in MySQL before).

Although not a priority, it's a fairly simple change that would make sense to do before any real sites are using the system. Any opinions?

@theninja theninja changed the title Should we consider using GUIDs rather than incremental integers for primary keys? Should we consider using GUIDs rather than incrementing integers for primary keys? Nov 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants