Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

UUID Concept

 
Ranch Hand
Posts: 401
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UUID is Unique Universal Identifier. I would like to understand how is it possible to generate the unique identifier universally? How UUID achieves this?
 
Saloon Keeper
Posts: 2656
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the Wikipedia article?
 
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A UUID/GUID (Microsoft's name for it) is as one person put it, is a generated value whose likelihood of being duplicated by any other generator (or for that matter the same generator) is about the same as the probability of random atoms rushing together in empty space to form a small walnut. The number of potential UUIDs in fact, exceeds the number of atoms in the Universe.

This makes them ideal for generating identifiers for distributed systems that need to periodically sync up, since each node of the system can generate IDs in the near-100% assurance that no other node would have assigned the same ID to something else. UUIDs have been used to distinguish OLE/COM service providers, uniquely identify disk drives and partitions without regard to where they are plugged in, and for many other purposes.

They are, in effect, very long (128 bit) random numbers and generated by much the same means. Java, in fact, has a UUID generator, so it's easy to create your own UUIDs.

One thing to note, however, is that since they are almost totally random, they make for lousy database keys, since they're rather large to be used as simple hash values, and they have no inherent order that would help optimise sequential searching and retrieval.

Some people consider UUIDs and GUIDs to be the same thing, but that's not entirely true. If you look at a Windows GUID, you'll notice that the displayed version of the ID is broken into parts. Originally Microsoft was parceling out specific high-level ID components for the benefit of themselves and registered developers. So only part of the GUID was truly random. Sometimes, indeed, very little of it.
 
Marshal
Posts: 6956
471
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have suspicion, that OP wants to know a bit more how actually the uniqueness is achieved across the globe (in simple words saying).

How the identifier is obtained, for instance: is the current time taken in consideration, date, maybe some local machines hardware figures, etc, etc...

@OP
Is that what's you worrying?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!