I'm trying to design a Neo4j graph database, and I will illustrate my specific requirement. I'm designing an app that allows users to collaborate on the books and magazines they have read. Requirements:
The same Book can be read by multiple people
The order in which a specific person reads the books is important. For example, I want to be able to represent that Person A read Books B1 and B2 in that order, while Person B may have read Books B3, B2 and B1 in that order.
I'm thinking of having nodes representing a Book, Magazine, Person, etc.
What is the best way to ensure the order/sequence information? A couple of options I thought about:
- Store a order ID or timestamp in the relationship between a Person and a Book node and use that to query all Books read by the person in the right order.
- Store a Next/Previous relationship between Book nodes, but this approach will not work because the order can vary depending on which person read the books.