What i have done in the past is create a data type called “id sequence” with a field called seed. then manually add 1 record into the live data base of 4 numbers.
Now as a user signs up it uses the seed and like what the other guys are saying it then +1 to the seed so it one number higher than for the next.
The difference with what i do though is when i create a user, in the field for id i will compose it like this:
Do search for id sequence’sseed:firstItem now finish the statement and open the composer again and put current date&time:formatted as custom and from memory its L that you want in the custom field and then use users timezone.
This means if your seed is 1234 then you would end up with 1234XX. L (from memory) stands for two of the millisecond digits. Its nearly impossible for 2 people to be right on the same millisecond especially since they would have to do that in the same time zone to end up with the same digits.
This in effect creates a certain amount of random, while keeping an increasing number and also creating the smallest possible time between changes in the time wise to stop any chance of doubles.
Hope that helps.