简体   繁体   English

不同的节点应该在不同的 Arango 集合中吗?

[英]Should Different Nodes Be in Different Arango Collections?

I'm new to graphing databases and am looking at a POC in ArangoDb.我是图形数据库的新手,正在查看 ArangoDb 中的 POC。 What is the best practice when designing a database?设计数据库时的最佳实践是什么? Specifically, should different but related node types be in seperate collections or in the same collection?具体来说,不同但相关的节点类型应该在单独的集合中还是在同一个集合中? (Think of a classic "student/class/location/tutor" scenario.) (想想经典的“学生/班级/地点/导师”场景。)

If the general consensus is to place everything in one collection then when would I need to consider multiple collections?如果普遍的共识是将所有内容都放在一个集合中,那么我什么时候需要考虑多个集合? Are there considerations for handling a high transaction rate, for example recording temperatures readings from a large number of devices?是否需要考虑处理高事务率,例如记录大量设备的温度读数? Would this be a case for recording device information in one collection and readings in another?这是在一个集合中记录设备信息而在另一个集合中读取的情况吗?

Yes, I'd suggest to put different node/vertex types in separate collections.是的,我建议将不同的节点/顶点类型放在不同的集合中。 So in your example you will have 4 vertex collections: "students", "classes", "locations" and "tutors".因此,在您的示例中,您将有 4 个顶点集合:“学生”、“班级”、“地点”和“导师”。 Then you probably want to create some edge collections, eg "HasAttended", to store edges from "students" to classes.然后您可能想要创建一些边缘集合,例如“HasAttended”,以存储从“学生”到类的边缘。

When designing the database, it may help to write down the data model on a piece of paper (or you can use a tool to visualize/edit it).在设计数据库时,将数据模型写在一张纸上可能会有所帮助(或者您可以使用工具对其进行可视化/编辑)。

I don't know your exact use case, but it makes sense to me to have a collection "devices" and another collection "temperatures".我不知道你的确切用例,但对我来说有一个集合“设备”和另一个集合“温度”是有意义的。 Then you can have an edge collection that stores edges between "devices" and "temperatures"然后你可以有一个边缘集合来存储“设备”和“温度”之间的边缘

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Arango DB图形中查询连接到多个节点的节点 - How to query for a node that is connected to multiple nodes in Arango DB graph 如何在Arango DB图中查询特定的节点组合 - How to query for a specific combination of nodes in Arango DB graph Neptune Jupyter notebook 中节点的不同图像 - Different image for nodes in Neptune Jupyter notebook 在具有不同属性的节点之间创建相同的关系 - Create same relationships between nodes with different properties Neo4j 将日期时间值作为不同节点处理 - Neo4j handling date time values as different nodes neo4j图形数据库中是否可能具有不同类型的节点 - Is it possible to have different types of nodes in a neo4j graph database 查找通过 2 个关系连接到至少 2 个相同节点但中间节点不同的节点 - Finding nodes which are connected to at least 2 same nodes through 2 relationships but with the intermediary one being different 相同类型的多个关系,但在相同的两个节点之间具有不同的属性 - Multiple relationships of the same type but with different properties between the same two nodes 如何返回neo4j中具有一定关系的节点,然后返回与第一个节点具有不同关系的节点? - How do I return nodes in neo4j that have a certain relationship, and then return nodes that have a different relationship with the first nodes? 如何通过使用Gremlin在图中通过公共同级对不同父级的所有同级节点进行分组 - How to group all sibling nodes from different parents by common sibling in a graph using Gremlin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM