cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Create new relation between customer and product for each purchase or

Gosforth
Graph Buddy

... increment relation 'no_of_purchases' property when customer purchase product again?

Which approach will be better from performance perspective?
I expect it will go much faster to create new relation than update relation property value. But probably it will take longer time to get answer 'show me customers' products where they have purchased at least X same product'.
We talk about dozens of thousands of customers and 20-40 thousands of products.
What would you recommend?

Regards,
G.

1 ACCEPTED SOLUTION

MuddyBootsCode
Graph Steward

If you know the ids for both the customer and the product incrementing a property on the relationship shouldn't have any adverse effects on operation speed. I would think it would be preferable to put the property on the relationship and spare yourself the creation of multiple relationships and attempting to traverse them.

View solution in original post

1 REPLY 1

MuddyBootsCode
Graph Steward

If you know the ids for both the customer and the product incrementing a property on the relationship shouldn't have any adverse effects on operation speed. I would think it would be preferable to put the property on the relationship and spare yourself the creation of multiple relationships and attempting to traverse them.