Hello, everyone.
I've got a need to generate a distributed unique id for every object that'll be transmitted in my distributed system. Can UUID be used under this circumstance?
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Hello, everyone.
I've got a need to generate a distributed unique id for every object that'll be transmitted in my distributed system. Can UUID be used under this circumstance?
This should answer your question about UUID in your title.
Universally unique identifier - Wikipedia, the free encyclopedia
There are 340,282,366,920,938,463,463,374,607,431,768,211,45 6 possible UUIDs (16 to the 32nd power), or about 3 × 10^38. Or 340 undecillion.
So the odds of you getting a duplicate copy, as you can see, are very infinitesimal.
Another way of looking at it is this way:
If you want to assign UUIDs to your objects, let's say you have seven billion objects. You would be able to assign over 48,611,766,702,991,100,000,000,000,000 UUIDs (That's 48 octillion) to each object. If my math is right.
Last edited by mjr; June 29th, 2012 at 06:26 AM.