Click here to Skip to main content
15,887,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Mysql Table Overflow Issue:

We have unlimited number of users in our web site. But MYSQL table, we have some limit for the primary key field.

If we use BIGINT as data type then we should store the user records upto "18446744073709551615".

My query is how to store the unlimited records. What is the best solution for solve this issue?

If we use auto increment process in application layer, I think may be problem will occur for simulataneous request.
Posted

You really should not worry about hitting the limit of bigint or even int since you are more likely to run out of disk space before that.

And well before that you will need to re-architect your site to handle the loads.
 
Share this answer
 
UUIDs[^] can generate up to 340,282,366,920,938,463,463,374,607,431,768,211,456[^] unique values. However, I think performance will be one of the major concerns here because you will be using 32 bytes, vs. the 8 bytes of BIGINT.

IMHO, the only time that you will be having a problem of reaching the limit of BIGINT is when your database is not normalized.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900