Design and Implementation of a Scalable Scenario Query System for Meituan
Meituan built a scalable scenario‑query platform that unifies traffic, activity and investment data by layering RPC services, a Storm‑driven pre‑computation tree stored in Redis/Tair, and a middle‑platform API with circuit‑breaker logic, cutting response times from seconds to under one second while dramatically reducing code coupling and simplifying future feature development.
Meituan, the largest lifestyle service platform, needs to support granular scene queries and intelligent suggestions for billions of users across millions of POIs. The system addresses three key problems: locating real‑time and historical traffic, understanding past activities in a target area, and recommending suitable investment locations.
The main challenges are massive data volume causing unacceptable real‑time response times, numerous RPC services whose latency accumulates, and the absence of a unified data model leading to high code coupling.
The solution adopts a layered architecture: bottom RPC services, a pre‑computation layer, a middle‑platform service layer, and business‑logic on top. The backend service layer provides Thrift RPC interfaces delivering raw feedback data.
Data assembly combines results from multiple services, filtering and intersecting list‑type responses while handling single‑value data, as illustrated in the original Fig 3.
To overcome assembly bottlenecks, the system pre‑computes and stores results. The pre‑computation layer builds a generic two‑level tree data model (aggregate root and geographic leaf nodes) and performs high‑density parallel computation using Apache Storm, enabling real‑time updates.
The tree model is persisted in a NoSQL KV store: Squirrel (Redis‑cluster) for fast writes and Tair for backup, keyed by ID+level to retrieve any node efficiently.
Two computation modes are compared: a serial layer‑by‑layer approach with high time and space complexity, and a parallel Storm topology that reduces both by processing each layer concurrently and streaming results downstream.
The middle‑platform service layer exposes unified RPC APIs for pagination, compression, filtering, batch extraction, and atomic retrieval, while integrating Rhino for circuit‑breaker and fallback mechanisms.
After deployment, response times dropped from several seconds to under one second, coupling between data and code was significantly reduced, and development effort for future feature changes was minimized.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Meituan Technology Team
Over 10,000 engineers powering China’s leading lifestyle services e‑commerce platform. Supporting hundreds of millions of consumers, millions of merchants across 2,000+ industries. This is the public channel for the tech teams behind Meituan, Dianping, Meituan Waimai, Meituan Select, and related services.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
