How JD Calculates Real-Time Prices: Inside Their Scalable Nginx‑Redis Architecture
This article explains how JD.com derives the displayed "JD price" from base prices and promotion rules using a real‑time pricing system built on Nginx, Redis clusters, and Tomcat, detailing the data flow, caching strategy, and disaster‑recovery mechanisms.
In JD.com’s product detail page, the “JD price” is computed from the product’s base price and promotion rules, supported by a real‑time pricing system.
The simplified architecture consists of an Nginx+Redis layer that stores pre‑computed full‑price data, and an Nginx+Tomcat business layer that performs price calculations.
When a promotion expires or a product lacks cached price, the business layer reads promotion data from a “promotion Redis”, fetches base information from the product service, computes the new price, and writes it to the “main price Redis” node, which updates the Nginx+Redis layer.
The “promotion backend” maintains promotion information in a database, while a “publishing program” reads this data, writes it to the promotion Redis master, calculates the latest price, and updates the main price Redis node.
Four promotion Redis clusters are used (one master and three slaves) to distribute replication load and provide disaster‑recovery capabilities.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
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.
