title: mysql UUID() and java UUID.randomUUID()
body: <p>I'm wondering if I can safely replace ids generated with mysql's UUID() function with ids generated by java's UUID.randomUUID() function?</p>
  
  <p>I'm looking to share these ids in urls with my users, but the mysql UUID() output looks very similar to each other after a few runs:</p>
  
  <pre class="lang-none prettyprint-override"><code>3ae2c9c4-47df-11e1-8c2a-a46b34c02a9e
  976de634-47e3-11e1-8c2a-a46b34c02a9e
  530cc5c6-47e7-11e1-8c2a-a46b34c02a9e
  ...
  </code></pre>
  
  <p>I'm not saying they're not unique, but is this how the results of UUID() usually appear? I suppose it's tied to some identifier on my machine.</p>
  
  <p>Java's UUID.randomUUID() "look" more random:</p>
  
  <pre class="lang-none prettyprint-override"><code>c042437b-298a-41c4-c2b6-0f83552bdb8b
  e33d8ab7-d9d3-4ffe-a592-650a125d2a93
  ecb12c54-5741-45c8-8b85-1825c19a9cae
  ...
  </code></pre>
  
  <p>From my naive understanding of uniqueness, the ids generated by the java method should work as a perfect replacement for mysql's UUID()? </p>
  
  <p>(another bonus for using java's version is that I won't have to re-fetch an inserted record which uses UUID() when I need to provide it in a reply to a client)</p>
  
  <p>Thank you</p>