Documentation - Unique Id Generation
All documents conforming to the Regno Standard must be given a unique identifier at creation time.
The allocation of a unique identifier per document allows for both document parenting, for example the ConfigDoc document and all associated child documents, and for the efficient reuse of documents, for example the ParamDefinitionDoc document.
The recommended method for the generation of the unique identifier string is by the calculation of a hash of all fields and values (excluding the id field) that are contained in the document. For some documents, some fields are excluded from the hash generation to allow for the updating of document data without requiring a new document hash to be generated. These additional fields that are to be excluded in the hash generation are noted in the Description column text for each appropriate field.
By employing a hash value as the document identifier, each time a new document is created, the new document can be checked to validate if the document already exists within the document store, and if so the existing document can be reused without any action, saving both storage and compute resource.
Employing a hash as the unique identifier also enables data pools of documents to be merged and synchronised from different data sources and locations without risk of data corruption.