Comprehensive Overview of Payment System Architecture and Core Components
This article presents a detailed overview of typical payment system architecture, describing the division between transaction and payment cores, their interactions, key modules such as transaction core, payment core, channel gateways, data consistency, service governance, and practical production considerations like performance testing and stability management.
Payment is the core domain of a company, and the article outlines the typical structure and interaction of payment systems, dividing them into a transaction core and a payment core, and describing their components and workflows.
1. Payment System Overview
Core System Interaction
Business Map
2. Core System Analysis
Transaction Core
The transaction core links business systems with underlying payment mechanisms, allowing business systems to focus on business logic without dealing with payment details.
Transaction Core
Basic Transaction Type Abstraction
Multi‑Table Aggregation & Order Association
Payment Core
The payment core abstracts multiple payment types into four forms: 充值, 提现, 退款, and 转账. It also integrates various payment tools and orchestrates payment commands.
Payment Core Overview
Payment Behavior Orchestration
The goal is to achieve 插件式开发 and configurable payment rules for flexible development.
Exception Handling
Handles scenarios such as duplicate payments, partial payments, amount mismatches, and other exceptions.
Channel Gateway
Fund Management
3. Service Governance
Unified Platform Context
After defining system boundaries and business modeling, the payment platform is split into dozens of services. A unique business identifier is propagated across the entire platform to prevent information loss.
Data Consistency Governance
Large payment companies often adopt strict distributed transaction solutions, sacrificing development efficiency for data stability. The article discusses alternative strategies when distributed transactions are not used.
CAS Validation
Idempotency & Exception Compensation
Reconciliation
Near‑Real‑Time Reconciliation
Database Sharding
Asynchronization
To improve stability and efficiency, the payment flow is heavily asynchronous.
Message Asynchronization
External Payment Call Asynchronization
External payment often requires obtaining a pre‑payment credential from third‑party services, which can cause long response times and block the payment chain; asynchronous gateway services mitigate this issue.
Asynchronous Parallelism
Fund Accounting Asynchronization
Hot Account Separate Processing
Accounting Transaction Splitting
4. Production Practice
Performance Testing
Build load‑testing models that simulate real scenarios, store test data in shadow databases, and monitor both single‑machine and centralized link performance to assess system stability and capacity.
Stability Governance
Core Link Separation
Service Dependency Degradation
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.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
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.
