Re: Pointer to the CF code that generates org and service instance guids?

Eric Malm <emalm@...>

Hi, Jean-Sebastien,

V4 UUIDs contain 122 bits of information (, so there are approximately
5.3 × 10^36 distinct ones. Since the Ruby implementation that Joseph
referred to generates them randomly, we can assume them to be distributed
uniformly across the sample space. From the approximation formulas in,
for there to be even a one-in-a-billion probability of a collision, you
would have to be using more than 10^14 UUIDs simultaneously as organization
guids. If you have, say, only a million org guids in play, the probability
of a collision decreases to about 10^-25.


On Tue, Oct 20, 2015 at 10:28 PM, Jean-Sebastien Delfino <
jsdelfino(a)> wrote:

Thanks that helps. I have a few follow up questions:

Can you quantify 'mathematically incredibly likely'?

How do you guarantee uniqueness for a single deployment (since AIUI
they're generated randomly)? Are you using the CC database for that?

What would it take to guarantee uniqueness across deployments? (I'm asking
as cloud platforms out there usually run in several datacenters or regions,
i.e. multiple deployments, so to me it would make sense to provide a way to
implement that guarantee, for example by allowing the uuid to be generated
from a namespace/name like described in RFC 4122 section 4.3 [1], but
there's probably many other ways to do this...)



- Jean-Sebastien

On Fri, Oct 9, 2015 at 11:08 PM, CF Runtime <cfruntime(a)> wrote:

Org and Service Instance guids are generated by the Cloud Controller. It
simply uses the SecureRandom.uuid ruby method:

SecureRandom.uuid implements RFC 4122 and generates guids randomly. The
guids for orgs are guaranteed to be unique for a single deployment, and
mathematically incredibly likely to be unique across all deployments.

CF Release Integration Team

On Fri, Oct 9, 2015 at 2:51 PM, Jean-Sebastien Delfino <
jsdelfino(a)> wrote:

Hi all,

Could somebody from the CF team point me to the CF code that generates
org and service instance guids?

Are the generated guids globally unique across multiple
deployments/instances of CF? or only unique within a single instance of CF?


- Jean-Sebastien

Join { to automatically receive all group messages.