Database-relation Systems
The relationship between databases and Hexabase is explained here.
Database related and data links
A Hexabase data store can be operated like a relational database, but the actual mechanism is storing items as documents in mongoDB and managing relations in ArangoDB. For this purpose, Hexabase has the following entity data that represents the relationship:
- Database Related: Defines relationships between databases
- Data link: link to items that have a relationship
Each relationship/link has a direction, and the related source database ⇒ Set as the related database. Settings must be done in each DB in order to have a bidirectional relationship.
The associated destination database can be configured across applications. This can be used in the following cases:
- The common master application has master data and refers to it in each business application
- Refer to the sales application data in the purchasing application
Comparison of RDBMS and Hexabase datastores
--- | RDB | Hexabase |
---|---|---|
DB design | Relationship model (E-R diagram) | Relationship model (E-R diagram) |
Relation | No entity data | Have entity data |
Search | Table with a JOIN in the SELECT statement.実行時に結合。Performance degrades depending on table structure | Pre-merge with data link。High speed for searching by following data links |
Update | Update only records, No need to update relations > Easy to guarantee ACID | Data link are also update when item is updated > Updates may take some time. |
Transaction | Can be | Transaction support for major APIs: CreateItem API, UpdateItem API, ExecuteAction API |
Database-relation configuration steps
Perform the database-relation settings using the following steps:
- 案件一覧のデータベース設定を呼び出す
- Open the “Database relation settings” tab
- Specify “Project details” in “Database related”
※ More detailed database-related configuration procedures are described in Admin panel reference > Database relation.
Manipulate related items via API
Related items can be manipulated with the following API.
Specify related items when creating or updating items
Specify related items in the related_ds_items option for each API.
- CreateItem API:Create a new item https://apidoc.hexabase.com/docs/v0/item-actions/CreateItem/
- UpdateItem API:Update the item https://apidoc.hexabase.com/docs/v0/item-actions/UpdateItem/
- ExecuteAction API:Execute action https://apidoc.hexabase.com/docs/v0/item-actions/ExecuteAction
Add, update, or delete data links to related items
- AddItemLink API:Add links to related items https://apidoc.hexabase.com/docs/v0/item-links/AddItemLink
- UpdateItemLink API:Updated links to related items https://apidoc.hexabase.com/docs/v0/item-links/UpdateItemLink
- DeleteItemLink API:Delete links to related items https://apidoc.hexabase.com/docs/v0/item-links/DeleteItemLink
Manipulate relation items on the administration panel
Once a database relation is set up, a list of related items will be displayed on the "Related Data" tab of the item detail page. You can add, update, and delete related items here.