Design and Architecture of an Online Checkout System
This article explains the concepts, scenario challenges, functional features, third‑party integration, rule‑engine design, and big‑data handling strategies behind a scalable online checkout system, providing a comprehensive view of its backend architecture and implementation.
1. Background introduction explains the analogy of a physical checkout and the need to understand the underlying processes of online payment, including concepts such as 收单 (collection), 提现 (withdrawal), 打款 (remittance), and 三方 (third‑party).
2. The article defines a checkout page as the UI where users select a payment method and complete the transaction, illustrating its position in the overall purchase flow.
3. Several scenario problems are discussed: determining the payee and payment method, verifying whether the user has actually paid, preventing transaction amount tampering, and handling duplicate payments.
4. Functional overview shows the checkout UI across mobile app, mini‑programs and PC, the core visible elements (price, payment options) and hidden aspects such as environment‑dependent payment methods, multiple receiving accounts, credit‑card strategies, internal documents, and exception handling.
5. The capabilities of third‑party payment providers are introduced, emphasizing the need to integrate different SDKs for APP, mini‑programs, etc., and to configure available payment channels via parameters.
6. Implementation logic and architecture are described with interaction flow diagrams and a technical stack diagram, highlighting the sequence from order creation to payment confirmation.
7. A rule engine (Easy Rules) is used to separate business routing logic from code; rules consist of name, description, priority, match and execution logic, and are organized into business and scene rules to support multiple environments and versions.
8. To cope with massive data (billions of payment records), a cold‑hot database strategy is adopted: hot tables for recent data, cold tables stored in TiDB (a MySQL‑compatible distributed database), with fallback mechanisms for updates to cold data.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
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.