Backend Development 8 min read

Design and Implementation of a High‑Availability Coupon Platform with Distributed Storage (JimDB)

This article describes the architecture and optimization of JD.com’s coupon platform, covering the JimDB distributed in‑memory database for core storage, a massive distributed task system for product coupons, high‑availability strategies for store coupons, and the overall middle‑platform design that ensures scalability, low latency, and data consistency across millions of daily transactions.

Dada Group Technology
Dada Group Technology
Dada Group Technology
Design and Implementation of a High‑Availability Coupon Platform with Distributed Storage (JimDB)

In the era of mobile internet, JD.com’s "to‑home" service experiences explosive growth in APP users, requiring a robust coupon system to support millions of daily orders and provide seamless shopping experiences.

Core Storage – JimDB : To meet peak loads of millions of TPS and billions of QPS, the system caches all client‑side data in Redis, backed by the internally developed JimDB distributed in‑memory database, which offers automatic elastic scaling, failover, master‑slave disaster recovery, and overload alerts.

Distributed Task System for Product Coupons : Product‑coupon caches are stored as string keys (couponID+storeID+productID) with values containing coupon details. Building these caches can involve up to 5 million tasks that must complete within ten minutes, using N queues persisted in MySQL and N worker threads that execute tasks every second. The system provides traceability, scalability, weighted priority, and lock‑free optimistic concurrency.

High‑Availability Store Coupons : Store‑level coupons serve as a critical marketing tool, handling massive concurrent access (up to 1.5 GB/s traffic) while keeping response times under 100 ms. Strategies include data source splitting (store coupons, freight coupons, red packets), key minimization, value field compression, batch MGET queries, and application isolation to protect core transaction flows.

User Coupon Distributed Storage : User coupons are stored in a hybrid MySQL + Redis architecture, with Redis hash structures (key=userID, field=couponUID, value=user+couponInfo) providing high availability and fast lookup. Peak TPS reaches 150 k/min, with daily issuance scaling to billions, prompting sharding of 1024 tables into eight databases and periodic archiving of cold data.

Coupon Middle‑Platform Challenges and Refactoring : Rapid addition of new coupon features led to duplicated code and tight coupling between business and service layers. The solution reorganizes the system into a middle‑platform architecture: a business middle‑platform for isolated feature logic, a technical middle‑platform offering generic services via RPC (e.g., coupon creation, redemption), and token‑based authentication for secure inter‑service communication.

Through these architectural improvements, the coupon platform achieved greater robustness, scalability, and faster iteration cycles, supporting JD.com’s high‑traffic, low‑latency requirements.

BackendSystem ArchitectureHigh AvailabilityCachingDistributed Storagecoupon
Dada Group Technology
Written by

Dada Group Technology

Sharing insights and experiences from Dada Group's R&D department on product refinement and technology advancement, connecting with fellow geeks to exchange ideas and grow 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.