Neo4j super node issue - fanning out pattern

前端 未结 3 408
臣服心动
臣服心动 2021-01-31 04:29

I\'m new to the Graph Database scene, looking into Neo4j and learning Cypher, we\'re trying to model a graph database, it\'s a fairly simple one, we got users, and we g

3条回答
  •  暖寄归人
    2021-01-31 05:15

    (disclaimer: not an answer, but some discussion)

    The 2013 neo4j blog post you mentioned links to this github commit, where the intended problem scope and its solution is discussed. To summarize, it does not address the general supernode issue. Instead, it alleviates the issue when, among multiple relationship types (and directions) that a supernode has, some of the types (directions) happen to have disproportionately less edges than the others. The engine is able to filter based on types and directions.

    A more generic solution is the vertex centric approach from Titan (https://stackoverflow.com/a/21385213/1311956), which sort the edges by one or a composite of properties, result in O(log(E)) searching performance, where E is the number of edges in/out of the supernode.

    Neo4j has the concept of index on relationships. Unlike vertex centric approach of Titan, the index is global. However, relationship index is a legacy one in Neo4j. This is discussed in another stackoverflow thread.

    Another issue with Supernode is the storage problem which leads to storage issue and IO cost.

提交回复
热议问题