Flight Booking System
Difficulty: MEDIUMCategory: HLDFrequency: 1Asked On 2023-11-10
Problem Statement
Design a Flight Booking System (like Amadeus, Sabre, or ClearTrip) that allows customers to search for flights, book tickets, manage reservations, and process payments. The system should handle real-time seat availability, integrate with multiple airline systems, and support millions of concurrent users during peak travel seasons.
Functional Requirements (FR)
User Management
•Register/login via email, phone, or social login.
•Manage user profile (name, contact, payment methods, travel preferences).
Flight Search & Discovery
•Search flights by source, destination, date, number of passengers, and class (economy/business).
•Filter by airline, stops, price, duration, etc.
•Real-time availability and pricing.
Booking Management
•Book one-way, round-trip, or multi-city flights.
•Manage Passenger Name Record (PNR) for reservations.
•Update/cancel bookings (with airline sync).
Payment Service
•Support multiple payment methods (cards, wallets, UPI, net banking).
•Handle refunds and cancellations.
•Ensure secure payment processing.
Seat & Inventory Management
•Real-time synchronization with airline systems for seat availability.
•Lock seats temporarily during booking flow.
Notifications & Itinerary
•Email/SMS/app notifications for booking confirmation, reminders, flight delays/cancellations.
•Generate downloadable e-ticket and boarding pass.
Ancillary Services (Optional)
•Add-ons: extra baggage, meal selection, seat upgrades.
•Loyalty points and reward programs.
Non-Functional Requirements (NFR)
•Scalability: Handle millions of flight searches & thousands of concurrent bookings.
•Consistency: Strong consistency for seat inventory and booking status.
•Availability: High uptime, especially during peak travel season.
•Low Latency: Search results should load within 1–2 seconds.
•Security: PCI-DSS compliance for payments, secure authentication.
•Reliability: No overbooking or duplicate seat assignments.
•Fault Tolerance: Resilient to failures in third-party airline APIs.
Core Components
1.User Service – Manages users, authentication, preferences.
2.Search Service – Aggregates flight data from multiple airline systems.
3.Booking Service – Manages PNR, seat locking, reservation lifecycle.
4.Payment Service – Handles transactions, refunds, and gateway integration.
5.Inventory Service – Syncs real-time seat availability with airline APIs.
6.Notification Service – Sends confirmation, reminders, cancellations.
7.Ancillary Services – Manages add-ons (baggage, meals, upgrades).
8.Analytics Service – Tracks user searches, popular routes, revenue trends.
9.Database Layer –1. SQL DB for bookings, payments, and users.2. NoSQL / Cache for flight search results.
Data Flow (High-Level)
1.User searches → Search Service queries airline APIs → aggregated results shown.
2.User selects a flight → Booking Service requests seat lock from airline.
3.User provides details & makes payment → Payment Service processes it.
4.On success → Booking confirmed → PNR generated → Notification Service sends ticket.
5.On cancellation → Airline + Payment Service handle seat release & refund.
Key Design Challenges
•Real-time synchronization with multiple airline systems.
•Avoiding double booking or overbooking during concurrent reservations.
•Handling spikes in search traffic (e.g., festivals, flash sales).
•Designing a resilient architecture against third-party airline API downtime.
•Ensuring secure financial transactions at scale.