evitaDB is a specialized database with an easy-to-use API for e-commerce systems. It is a low-latency NoSQL in-memory engine that handles all the complex tasks that e-commerce systems have to deal with on a daily basis. evitaDB is expected to act as a fast secondary lookup/search index used by front stores.
In certain situations we want to specify relations from the perspective of one entity, but allow them to be used (filtered / ordered by) from the other entity. Example situation:
ParameterValue relates to Parameter entity with cardinality EXACTLY_ONE.
But this relationship can also be seen from the opposite side as
Parameter refers to ParameterValue with cardinality ONE_OR_MORE
There is a 'predecessor' ordering attribute on the relation, which can be set when the ParameterValue entity is inserted, but we want to use it when we fetch related ParameterValues when querying the Parameter entity. So the value of the reference attribute must be synchronised with the value in the ParameterValue reference.
Currently evitaDB only supports unidirectional references and the data and its synchronisation has to be managed by the client application, which is quite problematic and requires additional work. The relational databases have these bidirectional relations "for free".
This would allow certain references to be marked as bi-directional and linked to references specified in different entities. This way the reference will be synchronised by the evitaDB engine on every update. The reference attributes do not have to be shared, but can be. The rules for attribute sharing will be as follows:
If attribute A is defined on bi-directional reference in entity X, attribute A: may not exist in reference of entity X.
must not exist in reference to entity Y
if it exists in reference of entity Y, it must share it's type and other settings.
The attribute definition from the other side should be similar to UseGlobalAttributeSchemaMutation.
The attribute modifications can be made from both sides of the reference and will automatically propagate to indexes in the other entity collection. evitaDB will ensure that the relation is consistent and in-sync from both points of view.
This should noticeably help the client logic to manage the relations consistently.
In certain situations we want to specify relations from the perspective of one entity, but allow them to be used (filtered / ordered by) from the other entity. Example situation:
ParameterValue relates to Parameter entity with cardinality EXACTLY_ONE.
But this relationship can also be seen from the opposite side as
Parameter refers to ParameterValue with cardinality ONE_OR_MORE
There is a 'predecessor' ordering attribute on the relation, which can be set when the ParameterValue entity is inserted, but we want to use it when we fetch related ParameterValues when querying the Parameter entity. So the value of the reference attribute must be synchronised with the value in the ParameterValue reference.
Currently evitaDB only supports unidirectional references and the data and its synchronisation has to be managed by the client application, which is quite problematic and requires additional work. The relational databases have these bidirectional relations "for free".
This would allow certain references to be marked as bi-directional and linked to references specified in different entities. This way the reference will be synchronised by the evitaDB engine on every update. The reference attributes do not have to be shared, but can be. The rules for attribute sharing will be as follows:
If attribute
A
is defined on bi-directional reference in entityX
, attributeA
: may not exist in reference of entityX
.Y
, it must share it's type and other settings.The attribute definition from the other side should be similar to
UseGlobalAttributeSchemaMutation
.The attribute modifications can be made from both sides of the reference and will automatically propagate to indexes in the other entity collection. evitaDB will ensure that the relation is consistent and in-sync from both points of view.
This should noticeably help the client logic to manage the relations consistently.