Movie DB - storing actors / actresses / tags?

I’m making a db film, and I don’t like the idea of ​​giving each actor / actress, as well as each tag, their own series, as if there were 10 million, each of them had at least 20-30 people, we will have 200-300 million rows in a table.

And it gets more complicated with tags that can be unlimited for every movie. So, what is the best way to store these 3 items? Ideally, they can be modeled as “Many to many,” but they will still have hundreds of millions of lines. Any better suggestions for keeping them? I am using MySQL.

I would dump it all in a text file, but I need to link the actors between the films, as well as do some analytics and allow users to evaluate how the actors find the films by tags, etc., so you need to use the DB.

+3
source share
4 answers

10 million films seem rather ambitious. Current IMDb statistics show that they have less than 1.8 million titles and about 3.9 million people.

Having said that, I see no problem creating a table of names, a table of participants, and a transition table in order to resolve the many-to-many relationship between them. The same applies to tags.

alt text

+2
source

? ?

. , , , 200-300 ( , 10 ?)

, () ( ), .

0

, , . TEXT - Movie, + , .

, :

Movie (ID)
Actor (ID)
Tag (ID) --horror, comedy, etc.

MovieActor (MovieID, ActorID)
MovieTag (MovieID, TagID)
  • : MovieActor MovieTag.
  • . 10 100 1 . , .
  • .
  • (sharding), .

, : , , ( , SLA ..)

0

10 20 30 ( ) 200-300 . , , , ​​, . ( - PK , , ); .

( SQL) .

0

Source: https://habr.com/ru/post/1781331/


All Articles