Data Management
This page discusses how to use Extra horizon services to manage data.
Last updated
This page discusses how to use Extra horizon services to manage data.
Last updated
For structured data, the Data service supports creating and manipulating JSON documents. Not only can these documents contain data, but they can also be configured to contain a certain level of logic. To achieve this, documents created with the data service rely on a data schema, which dictates the document's structure and behaviour.
Extra horizon services also provide storage for files that don't adhere to a particular structure, like images or zipped files. This service is called the files service
, and allows storage and retrieval of a large variety of files.
As previously mentioned, storage of structured data with ExH services relies on the data service
. This service stores data in structured documents and uses data schemas to determine the structure of these documents. Documents can also adapt to a configurable logic, which is also determined in the document's schema.
Before creating a new document, the data service requires a data schema. The purpose of a data schema is twofold: It dictates the data structure of a document, as well as the behavior logic of that same document. ExH data schemas are inspired by JSON-schemas and adhere to the same syntax.
Data structure
The primary function of a data schema is to ensure documents that are created with the data service
are uniformly structured. Data schemas use properties to dictate the data structure that is accepted to create the resulting document.
Configurable logic
Secondly, data schemas allow configuration of the behavior logic of a document, similar to a finite-state machine. This means that the document can possess one of a limited amount of states, and change between these states based on the configuration provided. Similar to properties, the states and transitions of a document are configured in its data schema.
Finite-state machines
A traffic light could be considered a finite-state machine. It can exist in three states: green, orange and red. Changing from one state to another is called a transition. In the case of a traffic light, that would mean it has three transitions: changing from green to orange, changing from orange to red, and changing from red back to green.
After configuring a data schema, any number of documents can be created that follow its structure. These documents will exist in the states that are defined by the schema's statuses, and follow the logic configured in the schema's transitions. As previously mentioned, transitioning a document between statuses can trigger actions such as sending a mail, or tasks that interact with other services.
While structured data is handled by the Data Service, some file types don't gain any significant benefit from being structured with JSON. Storing and retrieving unstructured data with ExH services can be done with the File Service.
The files service
provides a way of storing data without imposing a structure on it by way of schemas. This means the files service
allows the storage of a variety of file types with unstructured content, such as images and streams. Storing a file with this service will return a file token, which can be used as a reference to that file for further interaction. The files service
stores uploaded files together with metadata that describes the file, such as the name of the file, the file size and the file type.