Design and Optimization of MaFengWo Membership System Architecture
This article details the evolution, architectural redesign, and performance optimizations of MaFengWo's membership system, covering identity strategy transformation, four‑layer service architecture, rights pool construction, third‑party integration, points integration, concurrency control, traffic shaping, and risk management to support scalable, high‑quality user experiences.
As traffic dividends wane, the post‑Internet era demands better user experience and robust membership systems; MaFengWo began investing in a new membership architecture in 2019 to address these challenges.
Part 1 – Membership Identity Strategy Transformation – The early identity module combined product, user, and time attributes in a single‑level structure that was simple but not extensible. In 2019 the system was upgraded with richer acquisition channels, more diverse card types (quarterly, 7‑day, "FengXiang" cards, etc.), and lower entry thresholds, prompting a shift to a SKU‑based design that supports multi‑dimensional identity management.
The new model separates membership identity from product information, using SKU as the smallest granularity and adding source and acquisition channel data.
Part 2 – Membership Center Architecture Design and Optimization – The system is divided into four layers: data storage (MySQL, Redis, MES), core services, interface layer, and application layer.
Data Storage : MySQL, Redis, and a unified logging system (MES).
Core Services : Consist of four pillars – membership identity, rights, value‑added service integration, and points – plus transaction marketing and supporting modules such as risk control, monitoring, logging, message bus, and settlement.
Interface Layer : Exposes APIs for identity, rights redemption, and honey consumption.
Application Layer : Front‑end C‑end features like membership channel page, honey center, rights center, and task center.
2.1.1 Membership Identity – Multiple card types can coexist; SKU overlay and renewal models allow users to hold several identities simultaneously. A time‑axis diagram illustrates how overlapping SKUs determine the current effective identity. Configurable rules handle prerequisite (pre‑condition) and conflict identities, enabling flexible business logic.
2.1.2 Rights Center – A rights pool abstracts common attributes into immutable "rights material". Core attributes include rights type (coupon, discount, redemption code, third‑party jump), supplier, issuance timing (active or passive), and basic properties. The rights issuance flow shows how payment triggers rights distribution, with optional user‑initiated claim steps.
2.1.3 Third‑Party Rights Integration – Two integration patterns are used: (1) internal claim followed by asynchronous third‑party fulfillment, and (2) full third‑party claim flow with callbacks to adjust points. Both rely on asynchronous calls to isolate third‑party failures.
2.1.4 Membership Points – The existing "Honey" points system is integrated to drive user engagement, allowing point earning and redemption for various rights, and supporting future B‑side collaborations.
2.2 Marketing Activity Performance Optimization – To handle flash‑sale spikes, the team employs MySQL optimistic locking with a version field to prevent overselling, and uses Redis locks and rate‑limiting to throttle traffic before it reaches the database.
2.3 Risk Control – A sliding‑window rate‑limiter detects abnormal traffic, logs it to the MES system, and adds suspicious requests to a blacklist. Integrated with the company's risk‑control platform, alerts are sent via email or SMS for rapid response.
Part 3 – Summary and Outlook – The project highlights the importance of business‑driven refactoring over blind optimization, and outlines future directions such as membership tagging and user‑profile systems to further enhance the value of the membership center.
Architecture Digest
Focusing on Java backend development, covering application architecture from top-tier internet companies (high availability, high performance, high stability), big data, machine learning, Java architecture, and other popular fields.
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.