educative.io

Educative

Store information about movies and cinemas

Let’s assume each seat booking needs 50 bytes (IDs, NumberOfSeats, ShowID, MovieID, SeatNumbers, SeatStatus, Timestamp, etc.) to store in the database. We would also need to store information about movies and cinemas; let’s assume it’ll take 50 bytes. So, to store all the data about all shows of all cinemas of all cities for a day:

500 cities * 10 cinemas * 2000 seats * 2 shows * (50+50) bytes = 2GB / day

To store five years of this data, we would need around 3.6TB.

Why do we need another 50 bytes for movies and cinemas? Don’t we already have movieID in each booking?

Hi @Dewey_Munoz

Every cinema can play the same movie at the same time, therefore MovieId will vary from cinema to cinema and from city to city. Thus we have to store first information regarding the person and then regarding cinema. Through this, there`ll be uniqueness throughout the data although some more memory will be consumed.

@Shaheryaar_Kamal - still the information about movies and cinemas does not need to be repeated. the information for any given movie can be used across many bookings.