Skip to content

Object IDs (Spider)

JoeWinter edited this page Sep 18, 2014 · 1 revision

[Table of Contents](https://github.com/dell-oss/Doradus/wiki/Spider Databases: Table-of-Contents) | Previous | Next
Spider Data Model: Object IDs


Every object has a unique, immutable ID, stored in a system-defined field called _ID. Object IDs behave as follows:

  • IDs are variable length. Objects in the same table can have different ID lengths as long as every value is unique.

  • User applications set an object’s ID by assigning the _ID field when the object is created. It is the application’s responsibility to generate unique ID values. If two objects are added with the same ID, they are merged into a single object. That is, one "add" is treated as an “update” of an existing object.

  • To Doradus, IDs are Unicode text strings. To use binary (non-Unicode) ID values, user applications must convert them to a Unicode string, e.g., using hex or base64 encoding.

  • When IDs are included in XML or JSON messages or in URIs, some characters may need to be escaped. For example, the base64 characters ‘+’ and ‘/’ must be converted to %2B and %2F respectively in URIs. IDs returned by Doradus in messages are always escaped when needed.

Clone this wiki locally