Movie Ticket Booking System Design - Complete Low-Level Design Guide
Design a scalable Movie Ticket Booking System using Java and Spring Boot. Learn requirement analysis, UML class diagrams, seat booking algorithms, concurrency handling, payment integration, SOLID principles, design patterns, and enterprise architecture.
Introduction
Movie Ticket Booking is one of the most frequently asked Low-Level Design (LLD) interview questions because it models a real-world reservation system with concurrency, transactions, inventory management, and payment processing.
Popular platforms like:
- BookMyShow
- AMC Theatres
- Cinemark
- Regal
- PVR
- Cinepolis
process millions of ticket bookings every day.
The biggest challenge is ensuring that one seat is booked by only one customer, even when thousands of users attempt to book simultaneously.
In this guide, we'll design a production-ready Movie Ticket Booking System using Java and Spring Boot while applying SOLID principles, design patterns, and enterprise architecture.
Problem Statement
Design a movie ticket booking system that supports:
- Movie Management
- Theatre Management
- Screen Management
- Show Scheduling
- Seat Selection
- Seat Locking
- Ticket Booking
- Online Payments
- Booking Cancellation
- Refund Processing
- Notifications
Functional Requirements
The system should allow users to:
- Search Movies
- Search Theatres
- Search Shows
- View Seat Availability
- Lock Seats
- Book Tickets
- Make Payments
- Download Tickets
- Cancel Bookings
- Receive Notifications
Administrators should:
- Add Movies
- Add Theatres
- Configure Screens
- Schedule Shows
- Manage Pricing
Non-Functional Requirements
The system should be:
- Highly Available
- Thread Safe
- Fault Tolerant
- Scalable
- Secure
- Extensible
- Highly Concurrent
Actors
Actors include:
- Customer
- Theatre Admin
- Booking Service
- Payment Gateway
- Notification Service
High-Level Architecture
flowchart TD
CUSTOMER["Customer App"]
BOOKING["Booking Service"]
MOVIE["Movie Catalog Service"]
SHOW["Show Scheduling Service"]
SEAT["Seat Allocation Service"]
PAYMENT["Payment Service"]
NOTIFICATION["Notification Service"]
DATABASE["Booking Database"]
CUSTOMER --> BOOKING
BOOKING --> MOVIE
BOOKING --> SHOW
BOOKING --> SEAT
BOOKING --> PAYMENT
BOOKING --> NOTIFICATION
BOOKING --> DATABASE
Core Components
The system consists of:
- Movie
- Theatre
- Screen
- Show
- Seat
- Booking
- Ticket
- Payment
- Customer
- Notification
Domain Model
classDiagram
class Movie
class Theatre
class Screen
class Show
class Seat
class Booking
class Ticket
class Payment
Theatre --> Screen
Screen --> Show
Show --> Seat
Booking --> Ticket
Booking --> Payment
Customer --> Booking
Entity Responsibilities
Movie
Stores:
- Movie ID
- Title
- Language
- Genre
- Duration
- Rating
Theatre
Stores:
- Name
- Address
- Screens
Screen
Stores:
- Screen Number
- Seating Layout
Show
Stores:
- Start Time
- End Time
- Movie
- Screen
Seat
Stores:
- Seat Number
- Seat Type
- Status
Booking
Stores:
- Booking ID
- Seats
- Customer
- Status
Ticket
Stores:
- QR Code
- Show Details
- Seat Details
Payment
Stores:
- Amount
- Method
- Status
Seat Types
Regular
Premium
Recliner
VIP
Different seat categories have different pricing.
Booking Workflow
sequenceDiagram
participant Customer
participant BookingService
participant SeatService
participant Payment
Customer->>BookingService: Select Show
BookingService->>SeatService: Lock Seats
SeatService-->>BookingService: Seats Locked
BookingService->>Payment: Process Payment
Payment-->>BookingService: Success
BookingService-->>Customer: Booking Confirmed
Seat Locking
Seat locking prevents multiple users from booking the same seat.
flowchart LR
Available
-->
Locked
-->
Booked
Locked --> Timeout
Timeout --> Available
Typical lock duration:
- 5 Minutes
- 10 Minutes
After timeout, seats become available again.
Booking Lifecycle
flowchart LR
REQUEST["Booking Request Created"]
SEAT["Seat Lock Service"]
PAYMENT["Payment Gateway"]
TICKET["Ticket Service"]
FINAL["Booking Completed"]
REQUEST --> SEAT --> PAYMENT --> TICKET --> FINAL
Cancellation Flow
flowchart LR
BOOKING["Confirmed Booking"]
CANCEL["Cancellation Request"]
REFUND["Refund Processing"]
RELEASE["Seat Release System"]
BOOKING --> CANCEL --> REFUND --> RELEASE
Seat Status
Available
Locked
Booked
Cancelled
Blocked
Pricing Strategy
Pricing depends on:
- Seat Type
- Day
- Weekend
- Holiday
- Time Slot
Example:
| Seat Type | Price |
|---|---|
| Regular | $10 |
| Premium | $15 |
| Recliner | $20 |
| VIP | $30 |
Search Features
Users can search by:
- Movie
- City
- Theatre
- Language
- Genre
- Date
Design Patterns
Singleton
Booking Configuration
Factory Pattern
Payment Method
Creates:
- Credit Card
- Debit Card
- UPI
- Wallet
Strategy Pattern
Pricing Strategy
Examples:
- Weekend Pricing
- Holiday Pricing
- Dynamic Pricing
Observer Pattern
Booking Notifications
Subscribers:
- SMS
- Push Notification
State Pattern
Booking States
Created
↓
Locked
↓
Confirmed
↓
Cancelled
SOLID Principles
SRP
Booking handles reservations.
Payment handles transactions.
Notification handles communication.
OCP
Support new payment providers without modifying booking logic.
LSP
Every payment method behaves as a Payment implementation.
ISP
Separate interfaces for:
- Payment
- Notification
- Search
DIP
Booking Service depends on abstractions.
Concurrency
The biggest challenge is:
Two customers selecting the same seat simultaneously.
Potential problems:
- Double Booking
- Duplicate Payment
- Race Conditions
Solutions:
- Optimistic Locking
- Distributed Locks
- Database Transactions
- Seat Lock Timeout
Database Design
Tables:
Movie
Theatre
Screen
Show
Seat
Booking
Ticket
Payment
Spring Boot Layers
flowchart LR
Controller
-->
Service
-->
Repository
-->
PostgreSQL
REST APIs
Search Movies
GET /movies
Search Shows
GET /shows
Lock Seats
POST /seats/lock
Book Tickets
POST /bookings
Cancel Booking
POST /bookings/cancel
Download Ticket
GET /tickets/{id}
Enterprise Architecture
flowchart TD
CLIENT["Mobile App"]
GATEWAY["API Gateway"]
BOOKING["Booking Microservice"]
SERVICES["Supporting Services Layer"]
MOVIE["Movie Service"]
SEAT["Seat Service"]
PAYMENT["Payment Service"]
NOTIFICATION["Notification Service"]
DATABASE["PostgreSQL"]
CACHE["Redis"]
STREAM["Kafka Event Bus"]
CLIENT --> GATEWAY --> BOOKING
BOOKING --> SERVICES
SERVICES --> MOVIE
SERVICES --> SEAT
SERVICES --> PAYMENT
SERVICES --> NOTIFICATION
BOOKING --> DATABASE
BOOKING --> CACHE
BOOKING --> STREAM
Redis is commonly used for temporary seat locks.
Kafka publishes events:
- Booking Created
- Ticket Issued
- Booking Cancelled
- Refund Processed
Scaling Considerations
Large platforms support:
- Thousands of Theatres
- Millions of Customers
- Tens of Thousands of Concurrent Bookings
Scaling techniques:
- Redis Cache
- Distributed Locking
- Kafka
- Horizontal Scaling
- Read Replicas
- CDN for Images
Future Enhancements
Potential features:
- Dynamic Pricing
- Membership Plans
- Loyalty Points
- Food Ordering
- QR Code Entry
- AI Seat Recommendation
- Gift Cards
- Corporate Bookings
- Multi-language Support
- Facial Recognition Entry
Common Mistakes
❌ Ignoring seat locking.
❌ No transaction management.
❌ Payment before seat reservation.
❌ Hardcoded pricing.
❌ Tight coupling between services.
❌ No timeout for locked seats.
Interview Questions
- How would you prevent double booking?
- Why is seat locking required?
- How would Redis help in this system?
- Which design patterns would you use?
- How would you implement dynamic pricing?
- How would you support multiple theatres?
- How would you scale the booking service?
- How would you handle payment failures?
- How would you design the database?
- How would you support booking cancellation and refunds?
Summary
The Movie Ticket Booking System is an excellent Low-Level Design problem because it combines reservation management, concurrency, payments, notifications, and scalable architecture.
A production-ready implementation typically includes:
- Rich domain models
- Layered Spring Boot architecture
- SOLID principles
- Factory, Strategy, Observer, Singleton, and State patterns
- Seat locking with timeout
- Transaction-safe booking flow
- Payment integration
- REST APIs
- Event-driven notifications
- Redis caching
- Kafka-based event publishing
Mastering this design prepares you for advanced LLD interview questions such as Flight Reservation, Hotel Booking, Food Delivery, Ride Sharing, Online Examination, and Ticket Reservation Systems, all of which share similar patterns around inventory management, concurrency, and transactional workflows.