Design and Implementation of a Unified Voucher Issuance Platform for Baidu Waimai
This article describes the design, architecture, and operational features of Baidu Waimai's unified voucher issuance platform, detailing its four‑layer backend structure, permission and strategy configurations, flow‑control mechanisms, service isolation, monitoring visualizations, and re‑entrancy safeguards to support large‑scale marketing distribution.
Abstract: This article introduces a unified voucher issuance platform for Baidu Waimai, aiming to simplify the distribution of coupons, balances, and redemption codes for both internal and external marketing, reduce development costs, and centralize management.
Background: With increasing cooperation between food delivery and third‑party services, the demand for issuing virtual or physical items such as coupons and VIP codes has grown, requiring a flexible, reusable solution that avoids repeated development of diverse issuance strategies and provides reliable query and statistics mechanisms.
System Design: The platform follows a four‑layer architecture—Access Layer (authentication and rate limiting), Strategy Layer (selection of issuance types and combination controls), Service Layer (integration with downstream services like coupon and balance issuance), and Data Layer (asynchronous logging via message queues for tracing and monitoring). The design includes permission models (creator vs. administrator) and strategy configuration supporting multiple voucher types.
Stability: Flow control scripts monitor QPS per client and adjust request rates to keep overall traffic below warning thresholds. Service isolation is achieved through separate domains, clusters, databases, and caches, with priority handling for internal calls and dedicated message queues for statistics.
Visualization and Monitoring: A data visualization platform provides query capabilities for analysis, problem tracing, and traffic monitoring, while real‑time call dashboards display per‑client invocation rates and support future extensions for response time and timeout metrics.
Re‑entrancy Considerations: To prevent duplicate issuance in write‑heavy interfaces (e.g., balance or high‑value coupons), the platform employs Redis‑based distributed locks synchronized with downstream services, ensuring idempotent behavior and reducing downstream load.
Author: Liusha, head of the marketing voucher direction in Baidu Waimai User Product Department, leads the development of the issuance platform to achieve high‑concurrency stability and support million‑scale voucher distribution.
Baidu Waimai Technology Team
The Baidu Waimai Technology Team supports and drives the company's business growth. This account provides a platform for engineers to communicate, share, and learn. Follow us for team updates, top technical articles, and internal/external open courses.
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.