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
| Tier | Fare Level | Availability Rule | Typical Use |
|---|---|---|---|
| P1 | Lowest | Only when P5 available | Promo/sale fares |
| P2 | Low | When P4+ available | Early booking |
| P3 | Medium | When P3+ available | Standard economy |
| P4 | High | When P2+ available | Flexible fares |
| P5 | Highest | Always (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 │
│ │
└─────────────────────────────────────────────────────────────────┘
| Tier | Authorization | Protected Seats | Available After Lower Tiers |
|---|---|---|---|
| P1 | 20 | - | 20 |
| P2 | 50 | 30 from P1 | 50 |
| P3 | 100 | 50 from P1+P2 | 100 |
| P4 | 150 | 50 from P1-P3 | 150 |
| P5 | 180 | 30 from P1-P4 | 180 |
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
| Metric | Target |
|---|---|
| Availability query | <50ms |
| Inventory lock | <1ms (sub-millisecond) |
| Hold creation | <10ms |
| Concurrent searches | 1000+ |
| Hold window | 10 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
| System | Direction | Data |
|---|---|---|
| OMS | Bidirectional | Holds, sold updates |
| Offer Engine | Outbound | Availability by tier |
| Revenue Management | Inbound | Tier limits, overbooking |
| Schedule | Inbound | Flight creation, capacity |
| DCS | Outbound | Checked-in counts |
| NDC | Outbound | Availability 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):
| RBD | Typical Tier Mapping |
|---|---|
| F, A | P5 (Premium) |
| J, C, D | P4-P5 (Business) |
| Y, B, M | P3-P4 (Full Economy) |
| H, K, L | P2-P3 (Discount) |
| Q, V, W | P1-P2 (Deep Discount) |
Note: This mapping is for legacy interoperability only. The primary model uses P1-P5 tiers.