Actors embedded in movies & the use of 'max'

I’m wondering if the example of Chapter 2: Relationships: Relationship Types and Cardinality is right about embedding Actors inside Movies if we are considering that the Actors may be 1,000. Also, comparing this with the non-embedded entity of Reviews which we have a max of 100, shouldn’t it be the other way around? Reviews embedded in movies and Actors being referenced?

Also, I have a doubt about the use of ‘max’. By setting [0, 1000], are we saying we will be validating that amount of actors being in 1 movie to be maximum 1000 and no more? Or is this an approximate kinda like the most likely numeral notation and may be even 1200 or 1800? (I know these are a lot of actors :sweat_smile: but just for the sake of following the example) Because, I mean, I’m not a movie expert and I wouldn’t know how many actors a movie will have and I will most likely be wrong.

Thank you. :smiley:

It’s really just a fictitious example. It was merely to introduce the reader to Relationships from a document oriented point of view. I’m sure that Avengers would annihilate this schema if it were a real life implementation :grin:

Even Game of Thrones wouldn’t have that many actors :sweat_smile: But on a serious note, this is a fictitious logical model so don’t get hung up on these numbers. As MongoDB is schema-less database, we wouldn’t necessarily be enforcing anything at database level unless agreed. Once a physical model is designed, those numbers can be regarded as guides for the developers to enforce at application level or (if agreed), for the DBAs to enforce at db level.

2 Likes

Oh, I get it. Sometimes I get hung up on extra details.

Thank you