Inventory Management

Real-time flight inventory, availability, and capacity control systems. Uses a Classless Numerical Model (P1-P5) replacing the legacy 26-character booking class system.

Scope

Core Functions

  • Seat inventory management (physical and virtual)
  • Numerical tier availability (P1-P5)
  • 10-minute inventory holds during checkout
  • Overbooking policies and limits
  • Waitlist management

Inventory Types

  • Leg-based: Physical seats per flight segment
  • Segment-based: O&D (Origin-Destination) availability
  • Tier-based: Numerical price tiers (P1-P5)

Numerical Tier Model (P1-P5)

The Classless Philosophy

Abandoning the legacy 26 booking classes (A-Z RBDs) for a simpler numerical model:

┌─────────────────────────────────────────────────────────────────┐
│                                                                 │
│                    P5 (Highest Fare)                            │
│                   ┌───────────┐                                 │
│                   │           │                                 │
│              P4   │           │                                 │
│             ┌─────┴───┐       │                                 │
│             │         │       │                                 │
│        P3   │         │       │     Availability at P5          │
│       ┌─────┴───┐     │       │     automatically unlocks       │
│       │         │     │       │     P1-P4                       │
│  P2   │         │     │       │                                 │
│ ┌─────┴───┐     │     │       │                                 │
│ │         │     │     │       │                                 │
│ │   P1    │     │     │       │                                 │
│ │(Lowest) │     │     │       │                                 │
│ └─────────┴─────┴─────┴───────┘                                 │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Tier Definitions

TierFare LevelAvailability RuleTypical Use
P1LowestOnly when P5 availablePromo/sale fares
P2LowWhen P4+ availableEarly booking
P3MediumWhen P3+ availableStandard economy
P4HighWhen P2+ availableFlexible fares
P5HighestAlways (if seats exist)Last-minute/premium

Cascading Availability Rule

"Availability at P5 automatically unlocks P1-P4"

This simplifies Revenue Management:

  • No complex nesting logic across 26 classes
  • Clear tier progression
  • RM system sets availability at each tier
  • Lower tiers only open when higher tiers have inventory

Nested Booking Limits

Control inventory at each tier with nested protection:

┌─────────────────────────────────────────────────────────────────┐
│                 NESTED BOOKING LIMITS                           │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  Aircraft Capacity: 180 seats                                   │
│                                                                 │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │ P5 Authorization: 180 (full plane available)             │   │
│  │  ┌──────────────────────────────────────────────────┐   │   │
│  │  │ P4 Authorization: 150 (30 protected for P5)       │   │   │
│  │  │  ┌───────────────────────────────────────────┐   │   │   │
│  │  │  │ P3 Authorization: 100 (50 protected P4+)   │   │   │   │
│  │  │  │  ┌────────────────────────────────────┐   │   │   │   │
│  │  │  │  │ P2 Authorization: 50 (50 for P3+)   │   │   │   │   │
│  │  │  │  │  ┌─────────────────────────────┐   │   │   │   │   │
│  │  │  │  │  │ P1 Authorization: 20 (promo) │   │   │   │   │   │
│  │  │  │  │  └─────────────────────────────┘   │   │   │   │   │
│  │  │  │  └────────────────────────────────────┘   │   │   │   │
│  │  │  └───────────────────────────────────────────┘   │   │   │
│  │  └──────────────────────────────────────────────────┘   │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                 │
│  P1 sells out → P2 still has 30 seats (50-20)                   │
│  P2 sells out → P3 still has 50 seats (100-50)                  │
│  ...and so on                                                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘
TierAuthorizationProtected SeatsAvailable After Lower Tiers
P120-20
P25030 from P150
P310050 from P1+P2100
P415050 from P1-P3150
P518030 from P1-P4180

Revenue Management sets these limits dynamically based on:

  • Demand forecast
  • Days to departure
  • Historical load factors
  • Competitor pricing

10-Minute Hold Window

┌─────────────────────────────────────────────────────────────────┐
│                                                                 │
│   Customer selects flight → Inventory HELD (10 minutes)         │
│                                                                 │
│   ┌─────────┐                                                   │
│   │  Redis  │ ◄── Sub-millisecond inventory lock                │
│   │  Cache  │     during checkout                               │
│   └─────────┘                                                   │
│                                                                 │
│   If payment completed → Inventory SOLD                         │
│   If timeout (10 min) → Inventory RELEASED                      │
│                                                                 │
│   Prevents overselling during checkout window                   │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Implementation:

  • Redis cache for real-time deduct
  • Sub-millisecond inventory locking
  • Automatic release after 600 seconds
  • Prevents phantom inventory blocking

Data Model

Updated for Numerical Tiers

Flight
├── FlightNumber, Date, Route
├── Legs[]
│   ├── DepartureStation, ArrivalStation
│   ├── Aircraft, Capacity
│   └── PriceTiers[]
│       ├── Tier (1-5)
│       ├── AuthorizedCapacity
│       ├── SoldCount
│       ├── HeldCount
│       └── Available
└── Segments[] (O&D combinations)

Prisma Schema

model FlightInventory {
  id              String    @id @default(uuid()) @db.Uuid
  flightNumber    String
  flightDate      DateTime  @db.Date
  legOrigin       String    @db.VarChar(3)
  legDestination  String    @db.VarChar(3)

  priceTier       Int       // 1-5
  authorized      Int       // Capacity at this tier
  sold            Int       @default(0)
  held            Int       @default(0)

  updatedAt       DateTime  @updatedAt

  @@unique([flightNumber, flightDate, legOrigin, legDestination, priceTier])
  @@index([flightNumber, flightDate])
}

model InventoryHold {
  id              String    @id @default(uuid()) @db.Uuid
  orderId         String    @db.Uuid
  flightKey       String    // composite key
  priceTier       Int
  quantity        Int

  expiresAt       DateTime  // 10 min from creation
  createdAt       DateTime  @default(now())

  @@index([expiresAt])
  @@index([orderId])
}

Performance Requirements

MetricTarget
Availability query<50ms
Inventory lock<1ms (sub-millisecond)
Hold creation<10ms
Concurrent searches1000+
Hold window10 minutes (600 seconds)

Consistency Model

  • Display: Eventual consistency acceptable (cached)
  • Booking: Strong consistency required (real-time)
  • Holds: Atomic operations via Redis

Caching Strategy (Redis)

┌─────────────────────────────────────────────────────────────────┐
│                      Redis Cache Layer                          │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  availability:{flight}:{date}:{leg}                             │
│  ├── P1: 5                                                      │
│  ├── P2: 12                                                     │
│  ├── P3: 25                                                     │
│  ├── P4: 40                                                     │
│  └── P5: 50                                                     │
│                                                                 │
│  holds:{flight}:{date}:{leg}:{tier}                             │
│  └── Set of order IDs with expiry                               │
│                                                                 │
│  TTL: 60 seconds for availability                               │
│  Invalidation: On booking confirmation                          │
│                                                                 │
└─────────────────────────────────────────────────────────────────┘

Integration Points

SystemDirectionData
OMSBidirectionalHolds, sold updates
Offer EngineOutboundAvailability by tier
Revenue ManagementInboundTier limits, overbooking
ScheduleInboundFlight creation, capacity
DCSOutboundChecked-in counts
NDCOutboundAvailability responses

Research Topics

  • Redis cluster configuration for inventory
  • Hold expiration cleanup strategies
  • Overbooking optimization per tier
  • Real-time availability streaming
  • Multi-region inventory consistency
  • Waitlist management by tier

Legacy Reference (26 RBDs)

For backward compatibility with GDS systems (if needed):

RBDTypical Tier Mapping
F, AP5 (Premium)
J, C, DP4-P5 (Business)
Y, B, MP3-P4 (Full Economy)
H, K, LP2-P3 (Discount)
Q, V, WP1-P2 (Deep Discount)

Note: This mapping is for legacy interoperability only. The primary model uses P1-P5 tiers.