I'm learning about graph databases and have some questions about modeling. I examined the actor-movie example in the neo4j documentation, but wonder what to do if it gets a little bit more complicated, eg the case of actors appearing in theater plays?
With the actor-movies case the role relationship is ideal to put any properties like the character name. With theater plays, a character can be played multiple times in multiple productions. It's a ternary relationship. And because all relationships in neo4j are binary relations, some relationships have to be 'entitized'.
I tried to do this exercise in the attached file (acting.png)
- What's your feedback about this model? The entity ActingPrestation seems a little artificial to me.
- What about query performance? Quering all plays an actor played in becomes a lot harder. Should we duplicate the relationship and maintain a direct relationship between actors and plays or is it no deal for a graph database?