database design - Node in multiple linked list -


in our neo4j graph created serval linked list of top items specified category.

example:

top-50 week 2016-01 - mike posner - afrojack - willy william

at point created this:

 (node top 50 week 201601)-[first]->(node mike posner)-[next]->(node afrojack)-[next]->(node willy). 

but next week, order changed willy, mike, afro. , end having multiple next relationships on each artist. traversal list slower.

any idea, how model in better way.

the answer @stdob-- more valid, doesn't scale well.

imagine want find artists ever been number 1 , how many times, you'll have match of them traversing relationships , filter on rank property. nightmare if have 1 million artists.

the idea of linkedlist fine, nodes in linkedlist can example rankitem node related artist.

(week1)-[:first]->(rankitem)<-[:has_ranking_positon]-(artist) 

for previous question, can :

match (w:week)-[:first]->()<-[:has_ranking_position]-(artist) return artist, count(*) occurences 

depending on queries you'll need do, makes sense have rankinglist rankitem connect also.

(ranking {v:1})-[:next]->(ranking {v:2})-[:next]->(..... 

in case, rankingitem connect list

making things more performant questions :

based on artist, find me artists have common pattern of ranking history


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -