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

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.

主站蜘蛛池模板: 石狮市| 怀安县| 广元市| 祁东县| 闸北区| 哈尔滨市| 古田县| 九江县| 建水县| 衡南县| 东乡| 嘉祥县| 镶黄旗| 田林县| 离岛区| 册亨县| 门头沟区| 江油市| 博罗县| 扬中市| 远安县| 肇东市| 聂荣县| 屏东县| 安化县| 肇庆市| 云梦县| 安阳市| 湘乡市| 中牟县| 灵宝市| 明溪县| 临猗县| 新余市| 清水河县| 波密县| 孙吴县| 吉木乃县| 白沙| 平乐县| 长沙县|