Alipay is belong to the third party payment platform, alibaba’s payment platform system, pay treasure to pay is also the Chinese industry a pacesetter, both business capability and product ChuangDou leading China pay the forefront of the industry, as the basis of payment system complexity and stability is whether payments can be timely processing quickly and securely.
This payment circle collects the system architecture chart of Alipay, including: clearing, customer service, processing, capital, finance and so on. So this paper mainly introduces the internal architecture analysis of Android Alipay wallet system.
Overview of Alipay system architecture
Typical Processing default
Fund processing platform
The financial accounting
Payment and settlement
Accounting center
trading
Flexible transaction
The messaging system
The data distribution
Data cache
Metamorphosis(MetaQ) — Open Source Distributed Messaging Middleware of Alipay
Metamorphosis (MetaQ) is a high performance, high availability, scalable distributed messaging middleware, similar to LinkedIn’s Kafka, with sequential write message storage, large throughput and support for local and XA transactions and other features, suitable for large throughput, sequential messages, broadcast and log data transmission scenarios. It has a wide range of applications on Taobao and Alipay and is now open source.
Metamorphosis is a Java messaging middleware of Taobao open source. For messaging middleware, you’ve probably heard of the JMS specification, as well as open source implementations such as ActiveMQ and HornetQ. Metamorphosis is one of them.
The origins of Metamorphosis began with my study of linkedin’s open SOURCE MQ – now migrated to Apache’s Kafka, an MQ system with a unique design that uses pull rather than the push model of MQ. It makes a lot of use of ZooKeeper for service discovery and offset storage. I really appreciate and agree with its design concept, and I strongly recommend you to read its design document. In general, metamorphosis design is completely consistent with it.
But why do we need meta?
A quick summary of the reasons for rewriting meta:
1. Kafka is written in Scala, I’m not familiar with Scala, and Kafka as a community is growing too slowly;
2. There are some features that Kakfa does not implement that we need: transactions, multiple offset stores, high availability (HA), etc.
3. Meta features unique to Kafka:
- Text protocol design, very transparent, supports protocols like Memcached Stats to monitor brokers
- Pure Java implementation, from communication to storage, from client to server are re – implemented;
- Provides transaction support, including local and XA distributed transactions;
- Supports HA replication, including asynchronous replication and synchronous replication, to ensure message reliability.
- Supports sending messages asynchronously.
- Consumption message failed, support local recovery;
- Supports a variety of offset storage, database, disk, ZooKeeper, and customized implementation. Supports group COMMIT to improve data reliability and throughput.
- Support message broadcast mode;
- A series of supporting projects: Python client, Spout for Twitter Storm, tail4j, etc.
So meta is a huge improvement over Kafka. Meta has been widely used in Both Taobao and Alipay. At present, 12 billion messages are routed through Meta on Alipay and hundreds of millions of messages on Taobao every day.
Meta suitable applications:
- Log transport, high throughput log transport is kafka’s strength;
- Message broadcast function, such as broadcast cache configuration failure;
- Sequential synchronization of data, such as mysql binlog replication;
- Message routing in distributed environment (broker,producer and consumer are all clustered) with high requirements on sequence and reliability;
- Additional functionality for use as general MQ.
The author | xue ji, from | mobile to pay
Text source network, only for the use of learning, copyright belongs to the original author, if there is infringement, please contact delete.
I’ve compiled the interview questions and answers in PDF files, as well as a set of learning materials covering, but not limited to, the Java Virtual Machine, the Spring framework, Java threads, data structures, design patterns and more.
Follow the public account “Java Circle” for information, as well as quality articles delivered daily.