Design and Implementation of Delivery Promise System in ZuanZuan App
This article explains how ZuanZuan designs and implements a high‑performance delivery‑promise (fulfilment timing) system, covering the definition of delivery promise, the order‑OMS‑WMS‑TMS workflow, estimated‑arrival calculations, high‑QPS handling with caching and Redis, and the logic behind next‑day and same‑day delivery filters.
The article begins with a relatable story about a developer, Xiao Wang, who needs to buy a gift for his girlfriend and discovers the importance of accurate delivery‑time promises, introducing the concept of "delivery promise" (or "Promise").
It defines delivery promise as the estimated arrival time shown to consumers, helping them plan and reducing anxiety, and notes that most e‑commerce platforms now display this information.
The core of ZuanZuan's solution is described through four modules—Order, OMS, WMS, and TMS—detailing how an order flows from payment to warehouse dispatch and finally to logistics pickup.
For estimating delivery time, the system calculates the interval from payment to logistics pickup, then queries the carrier for the expected arrival, analogous to planning a high‑speed train trip in the story.
Concrete examples illustrate how different order cut‑off times map to specific delivery windows (e.g., ordering before 7:30 am results in delivery at 14:00 the next day).
To support tens of thousands of QPS, the article identifies the bottleneck in the pickup‑to‑ETA lookup and introduces a pre‑warming strategy: daily calculations of ETA for each warehouse are stored in Redis, while additional caches (local memory and Redis) accelerate address conversion, inventory location, warehouse info, and pickup matching.
A table summarises the caching layers for each query type, showing how local cache and Redis reduce latency.
The next‑day, same‑day, and three‑day delivery filters are explained: products are tagged with supporting warehouses, and a pre‑warmed dataset is used to quickly determine eligibility without real‑time calculations. The storage evolves from a key‑list to a key‑zset structure, enabling efficient range queries on Redis.
Finally, the article concludes that the delivery‑promise system enhances user experience by providing precise ETA calculations, robust high‑concurrency handling, and flexible delivery‑option filters, and it anticipates further refinements as e‑commerce competition intensifies.
Architect
Professional architect sharing high‑quality architecture insights. Topics include high‑availability, high‑performance, high‑stability architectures, big data, machine learning, Java, system and distributed architecture, AI, and practical large‑scale architecture case studies. Open to ideas‑driven architects who enjoy sharing and learning.
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.