-1

I have the following hierarchy:

venue -> concert -> booking

And within booking I have a relationship for the concert. But should the booking also have a relationship to the venue? Or is it bad practice to have relationships at that depth?

What about if there was also a seat in a booking? Would a relationship to venue still be reasonable?

Or is it better to instead do two requests to get the venue? E.g. use the booking -> concert relationship to then get the relationship between the concert and venue?

1 Answer 1

0

It's generally a bad idea. But not because of anything to do with json.

The problem with putting the venue reference in two places is that you can end up with two different values.

2
  • Could you expand on that? How would I end up with two different values?
    – Levi H
    Dec 6, 2019 at 10:46
  • 1
    @LeviH: Booking A refers to concert A and to venue A. However, the entity of concert A itself refers to venue B. In which venue is concert A taking place? In which venue is booking A taking place? Because there are two sources of truth on venue reference (i.e. from bookings and concerts), you open the door to these two sources contradicting one another.
    – Flater
    May 4, 2020 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.