Architecting a movie ticket booking system

Santosh Yadav
3 min readJan 9, 2021

--

We are going to architect a movie ticket booking system. The client of the system will be Mobile App, Website and Mobile Web.

Use Case: User will search for a movie or scroll through a list of movie based on their location. User will have select a show time for the selected cinema hall. User can then choose seat(s) and provide payment information and get the booking confirmation.

Movie Ticket Booking Architecture

To display movie list, details and show timings, we need to create listing API to talk to aggregator cinema service and provide request details. We should aware of number of request for these APIs would be more, because there would be lot of people which will just browse through the latest movie and nearest cinema to know the show timings. So, we need Event Listener system which will listen to new change in Cinema listing, movie listing etc.. and update the cache database and RDBMS both. Listing API will rely on cache database. In some case, if cache does not have necessary data then it will make network call to RDBMS, put the data in the cache and send the response.

We should know that different Cinema Hall have their own ticket booking system for their ticket counters and websites. Each cinema have exposed their API endpoints. There is no standard of request payload and response among all, it cannot be! So, we need to build an aggregator cinema service which will take care of different types of payload and response. The aggregator cinema service will be the single point of contact for our own movie ticket booking system.

If user selects a show time of a movie then we need to display seating area. The seating layout will different for different cinema halls. We need to display SVG on the UI so that user can choose specific seat(s). We need a back-office system to feed co-ordinated of seats, so that I can be converted to SVG. So, Cinema SeatLayout API will get those co-ordinated based cinema hall and then UI can render it.

Seat Selection API will used to select seat will have status flags, the flags will be used to determine if it is Committed and payment done or not. The status will be Initiated, Seat Selected, Payment Failed, Cancelled and Committed. If a user left the transaction after selecting seats then we will mark it as cancelled and seat hold will be removed, so that a different user can select the same seat.

Payment API will take care payment transaction of different payment modes and vendors. It will send the transaction ID and will expect the status of payment against the ID. If payment is successful then the API will update the status of transaction as Committed and Communication API will send out the Email and SMS of ticket booking confirmation along with invoice.

Application load balancer will be in-place to receiving incoming traffic and distribute among the resource being deployed to serve. Then comes, the API gateway which acts as a reverse proxy, routing requests from clients to services. It perform various tasks such as authentication, SSL termination, and rate limiting.

This is a re-post of my original post on blogspot — https://santosh-yadaav.blogspot.com/2021/01/architecting-movie-ticket-booking-system.html

--

--

Santosh Yadav
Santosh Yadav

No responses yet