Backend Development 5 min read

Overview of Alipay System Architecture and the Open‑Source Distributed Messaging Middleware Metamorphosis (MetaQ)

This article presents an overview of Alipay’s comprehensive system architecture and introduces MetaQ (Metamorphosis), an open‑source Java‑based distributed messaging middleware, detailing its features, advantages over Kafka, and suitable high‑throughput, reliable messaging scenarios.

Top Architect
Top Architect
Top Architect
Overview of Alipay System Architecture and the Open‑Source Distributed Messaging Middleware Metamorphosis (MetaQ)

Alipay, a leading Chinese payment platform, has a complex and highly stable system architecture covering settlement, customer service, fund processing, finance, and more, which serves as a reference for other payment companies.

Key components include the funds processing platform, financial accounting, payment clearing, accounting center, transaction processing, and flexible transaction handling, illustrated with several architecture diagrams.

Alipay's Open‑Source Distributed Message Middleware – Metamorphosis (MetaQ)

Metamorphosis (MetaQ) is a high‑performance, highly available, scalable Java‑based distributed message middleware, similar to LinkedIn’s Kafka, supporting sequential writes, high throughput, local and XA transactions, and is widely used in Alibaba’s Taobao and Alipay.

The motivation for creating MetaQ includes limitations of Kafka (written in Scala, slower community development) and the need for features such as transactions, multiple offset storage options, and HA replication.

MetaQ’s distinctive features are:

Plain‑text protocol with memcached‑style stats for monitoring.

Pure Java implementation for client and server.

Transaction support (local and XA).

HA replication (asynchronous and synchronous).

Asynchronous message sending and local recovery on consumption failure.

Multiple offset storage back‑ends (database, disk, Zookeeper) with extensibility.

Group commit for higher reliability and throughput.

Broadcast mode for message distribution.

Ecosystem tools such as Python client, Storm spout, and tail4j.

MetaQ handles massive traffic, processing up to 12 billion messages per day in Alipay and hundreds of millions in Taobao.

Typical use cases include high‑throughput log transport, message broadcasting (e.g., cache invalidation), ordered data synchronization (e.g., MySQL binlog replication), and any scenario requiring reliable, ordered messaging in a distributed environment.

The overall architecture and internal structure of MetaQ are illustrated with diagrams in the original article.

backendsystem architecturehigh availabilityDistributed MessagingAlipayMetaQ
Top Architect
Written by

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.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.