Backend Development 20 min read

High-Concurrency Flight Pricing System Design and Optimization at Qunar

This article details Qunar's high‑concurrency flight pricing architecture, covering the origin of pricing data, two‑level caching design, a cache‑management system, CQRS‑based policy storage, data compression techniques, and performance improvements achieved through these optimizations.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
High-Concurrency Flight Pricing System Design and Optimization at Qunar

The article introduces the author, a senior Java development manager at Qunar, and outlines the massive scale of flight pricing queries—over 200 million searches per day across more than 20,000 domestic routes.

It explains the three core data elements of a flight quote (AV inventory, FD fare, and policy adjustments) and how they combine to form the final price presented to users.

It then describes the overall pricing architecture, including the RT caching layer, policy and direct‑connect calculation engines, and the external AV/FD data sources, highlighting the need for fast response and low interception rates.

The two‑level cache design (local JVM cache and Redis) is detailed, with cache keys, capacity, expiration, update, and eviction strategies, as well as the role of the Cache Management (CM) system in tracking update timestamps for each airline‑agent combination.

The article discusses the importance of CM for handling frequent policy updates, inventory changes, and fare adjustments, and explains how CM provides APIs for external systems to trigger cache refreshes.

It introduces the CQRS approach for separating policy write and read workloads, describing the write side (agent‑partitioned MySQL) and the read side (route‑partitioned search database), along with synchronization via Canal and periodic diff.

Data compression techniques are presented, including string compression to primitive types and the replacement of standard Java collections with high‑performance primitive collections (IntObjectHashMap, IntSet) to reduce memory usage and GC overhead.

Performance results show significant reductions in CPU and memory consumption, enabling the system to handle higher QPS with lower latency.

The conclusion summarizes the key takeaways for designing high‑concurrency systems: multi‑level caching, cache‑management services, CQRS for policy storage, and aggressive data compression.

backend architecturecachinghigh concurrencyCQRSdata compressionflight pricing
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.