Developer Deep Dive
- Databases
- Databases allow isolating sets of collections from one to another. Graph databases organize and store data using a graph-like structure, where data entities are represented as nodes and their relationships as edges (also called links).
- Collections
- Collections store documents, similar to how files are stored in folders. You can use them to group records of similar kinds together. Collection types include:
- Documents
- Documents are referred to the JSON objects store.
Following this structure, in Altair IoT Studio, each Space will have its own database in AnythingDB and the data will be separated from other Spaces.
Each database will have the following Collections (please note Collections cannot be removed and new ones cannot be created).
- Type document:
-
Categories
: store documents about the Categories definedModels
: store documents about the Models definedVersions
: store documents about the Versions of the different Models definedThings
: store documents about the Things definedpropertiesHistory
: store documents with the records of Properties definedactionsHistory
: store documents with the records of Actions definedeventsHistory
: store documents with the records of Events defined
- Type edge:
-
Links
: store connections between Things. Note that connections between other elements are not allowed.
Each Collection will contain multiple documents. Each document could be defined with a set of attributes as shown in the schema below:
It is now possible to run custom queries directly on the database. New endpoints have been added to execute AQL queries that will run in the ArangoDB database where the AnythingDB's Space information is stored.
The new endpoints that we have created are compatible with the ArangoDB API, so it means handling ArangoDB cursors. Here is the documentation about ArangoDB query and how to use it.