Home › Data Modelling › BookMyShow
Data Modelling · Worked example

Where does a booking's data go?

Follow one movie ticket booking on a BookMyShow-style app, from tapping two seats to the revenue dashboard. Press play, or step through it.

Step 1 of 8

The data model

The tables behind it

The transactional (OLTP) tables the app reads and writes on every booking.

CITY · VENUE · SCREEN

Where shows happen. Changes rarely.

  • venue_id PK · city_id FK
  • screen_id PK · venue_id FK
  • name · total_seats

SEAT

The physical seat layout of a screen.

  • seat_id PK · screen_id FK
  • row_label · seat_no
  • seat_class (Recliner, Gold, Silver)

EVENT · SHOW

A movie or event, and each time it plays on a screen.

  • event_id PK · title · language
  • show_id PK · event_id FK, screen_id FK
  • start_time · format (2D, IMAX)

SHOW_SEAT

One row per seat per show. The key table.

  • show_seat_id PK · show_id, seat_id
  • price · status (AVAILABLE, LOCKED, BOOKED)
  • locked_until · version

BOOKING · BOOKING_SEAT

What a user bought, and which seats.

  • booking_id PK · user_id, show_id
  • status · total_amount · created_at
  • booking_seat: booking_id, show_seat_id

PAYMENT

Every payment attempt and refund.

  • payment_id PK · booking_id FK
  • amount · method · status
  • gateway_txn_id (unique)

Design decisions that matter

The analytics model (star schema)

For reporting, the same data is reshaped in the warehouse around facts (what happened) and dimensions (how you slice it).

TableOne row perMain columns
fact_ticket_saleseat sold or cancelleddate_key, show_key, event_key, venue_key, user_key, seat_class, ticket_price, fee, is_cancelled
fact_show_occupancyshow, per dayshow_key, date_key, seats_total, seats_sold, occupancy_pct, gross_revenue
dim_datedaydate, weekday, is_weekend, is_holiday, month
dim_eventmovie or eventtitle, type, language, genre, release_date
dim_venuescreenscreen, venue, city, state
dim_showshowstart_time, time_band (morning, matinee, evening, night), format
dim_useruser version (SCD type 2)user_id, home_city, valid_from, valid_to