Documentation
April 25, 2019
The Aito database schema is a description of how the database is constructed and internally processed. A schema contains the information of:
The Aito database requires a defined schema before executing other operations. The schema is defined in the JSON format and populate to Aito using the Schema API Endpoint.
An example of the Aito schema:
{
"schema": {
"users": {
"type": "table",
"columns": {
"id": { "type": "String" },
"name": { "type": "String" },
"age": { "type": "Int", "nullable": true }
}
},
"messages": {
"type": "table",
"columns": {
"id": { "type": "String" },
"user": { "link": "users.id", "type": "String" },
"text": { "type": "Text", "analyzer": "English" }
}
}
}
}
Feature | Aito | SQL database |
---|---|---|
Schema needs to be defined before inputting data | yes | yes |
Relationship: one to many | yes | yes |
Relationship: one to one | yes | yes |
Relationship: many to many | no | yes |
Directional (one-way) links | yes | yes |
Bidirectional links | no | yes |
Joining over link depth >1 | no | yes |
The relationship between tables in the database are defined by links. Linking is crucial in order to help Aito to take other tables into consideration when performing machine learning operations. Please refer to the Utilizing Relationships in Aito article for more details.
Considering a case where you have a "users" table containing the information of the user and a "user contacts" table containing contact information of the user.
This can be defined in the schema of the user contacts table:
"user": { "type": "Int", "link": "users.id" }
Considering a case where you have a "transactions" table and the "users" table. You can link from the transactions table to the users table with the id.
This can be defined in the schema of the user contacts table:
"user": { "type": "Int", "link": "users.id" }
Episto Oy
Putouskuja 6 a 2
01600 Vantaa
Finland
VAT ID FI34337429