DocumentDB auto generated ID: GUID or UUID? Which variant? -


tl;dr: ids auto-generated documentdb supposed guids or uuids, , there difference? if uuids, variant/version of uuid?

background: of documentdb client libraries auto generate id if not provide one. have seen mentioned in azure blog , in several related questions generated ids guids. know there some discussion on whether guids uuids, many people saying are.

the problem: however, have noticed of ids documentdb auto-generates not follow uuid rfc, allows digits 1-5 in "version" nibble (v in xxxxxxxx-xxxx-vxxx-xxxx-xxxxxxxxxxxx). documentdb generates ids hex digit in nibble, example d981befd-d19b-ee48-35bd-c1b507d3ec4f, version nibble first e of ee48.

it possible depends on client used create documents. in our documentdb database, have documents third grouping dde5, 627a, fe95, , on. these documents stored within stored procedure calling collection.createdocument() options {'disableautomaticidgeneration': false}. other documents create through third party documentdb studio application have 4xxx in third grouping, valid uuid version. however, documents create through azure portal have non-standard third groupings b359.

question: auto-generated documentdb ids supposed guids or uuids, , there difference? if uuids, variant?

poking around in source code on github, found various client , server side libraries use several different methods creating they're calling guid (in libraries) or uuid (in other libraries).

the nodejs client, javascript client, , server-side library manufacture call guid concatenating series of hex digits , hyphens. note these random, not comply rules creating rfc4122 version 4 uuids.

the python client , java client call respective standard library methods generate random (version 4) uuid.

the .net client available via nuget, source code not yet published.

summary:

  • microsoft not making distinction between guid , uuid in client libraries. using terms interchangeably.
  • what guid/uuid depends on client library you're using call documentdb when create documents.

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -