我有以下 SDN5 节点实体:
@NodeEntity
public class Decision {
@Index(unique = true)
private Long id;
}
@NodeEntity
public class Characteristic{
@Index(unique = true)
private Long id;
}
根据我的业务需要,我可以有几十万和几十上百个节点。Decision
Characteristic
我还需要将每个节点的值放在每个Decision
节点Characteristic
上。在某些情况下,我可以在相同Decision
和 `Characteristic.
我看到了两种可能的实现方式:
1.将value
属性放入和Decision Characteristic@RelationshipEntity
之间,该属性将包含一个数组。Decision
Characteristic. In case of multiple values(of the same types) between the same
and
value
2.引入新的Value
@NodeEntity
并添加两个@Relationship
forDecision
和Characteristic. In case of multiple values(of the same types) between the same
Decision and
Characteristic - 将创建所需数量的单独Value
节点。
我最大的标准是对用户需求的实时查询性能——Decisions
按Characteristics
.
考虑到这一点——我应该选择什么方式来创建所描述系统的模式——1
或者2
?
我知道@RelationshipEntity
不支持模式索引的属性(可以使用 APOC 关系属性手动索引添加此行为的模拟)。另一方面,@NodeEntity
支持属性的模式索引,但引入额外的 Value 节点会增加查询期间遍历的关系计数。
此外,如果同一Decision
和Characteristic in case of the solution with
@RelationshipEntity property must be represented as array property on
@RelationshipEntity` 之间有多个值,我不知道如何在那里索引数组。
请告知如何正确设计此类架构以及选择哪种方式。