官术网_书友最值得收藏!

Aligning relationships with use cases

One of the ways that you can model for query-ability and let your queries drive your model is by using the different relationship types that you can have between nodes for different use cases. Many great graph database models use multiple relationships between two of the same nodes for different use case scenarios.

One of the reasons why this a recommended best practice is actually applicable and of real use in practical development efforts is that the specialization tax, which is the price that you--as a developer--pay (mostly in terms of added model complexity) to introduce a specific relationship between two nodes for a specific use case, is in fact so low. There are no additional tables or schemas to be created, and to be even more specific, there are no additional joins to be computed. All that happens is that the graph traversals will use different paths to establish their course across the network stored in the database.

A key concept to be kept in mind when aligning relationships with use cases is the naming strategy for your relationship types. The general recommendation is to use as few generic names such as HAS_A or IS_PART_OF as possible, but to be more specific in these naming efforts.

主站蜘蛛池模板: 青阳县| 黄陵县| 安顺市| 兴义市| 东山县| 运城市| 全州县| 南投县| 西城区| 昆明市| 邵东县| 德钦县| 高台县| 襄城县| 岳普湖县| 巢湖市| 奎屯市| 曲阜市| 漳浦县| 岗巴县| 台湾省| 洛川县| 景宁| 大安市| 吉林省| 嵊州市| 嘉荫县| 纳雍县| 滁州市| 那坡县| 桐柏县| 宝山区| 松潘县| 土默特左旗| 赣榆县| 尼木县| 津市市| 梓潼县| 营山县| 景德镇市| 远安县|