How JD Scales Its Product Detail Page for Billions of Views

This article explains JD's technical practices for handling massive traffic on product detail pages, covering front‑end rendering, KV storage, Nginx + Lua dynamic templating, unified service systems, monitoring, caching strategies, service isolation, and automated degradation mechanisms.

21CTO
21CTO
21CTO
How JD Scales Its Product Detail Page for Billions of Views

Product Detail Page Services

The detail page includes HTML rendering, pricing, promotions, inventory, advertising, flash‑sale, reviews, trial, recommendations, product introduction, and category‑specific services.

Evolution of Detail Page Architecture

Initially built with .NET, the system moved to static page generation via Java fragments, which caused issues with file‑system inode limits and full‑page regeneration when templates changed. To address latency and scalability, JD switched to a dynamic architecture: data is stored in a KV store, and the front‑end uses Nginx + Lua to render pages on the fly, achieving sub‑50 ms response times.

Unified Service System for Detail Page

A unified access layer routes all page requests through a single system, providing monitoring, graceful degradation, and data heterogeneity handling. It aggregates data from multiple dimensions such as product, category, merchant, and brand, storing each dimension separately for efficient retrieval.

Core Design Ideas

Heterogeneous data storage: ingest external data into our own dimensional model to avoid dependency on third‑party APIs.

Service closed‑loop: centralized monitoring and automatic downgrade (e.g., fallback to "in‑stock" when inventory service degrades).

Dimensional storage: retrieve data in two calls—product info and related metadata.

Unified Access and Proxy Layer

Unified entry point forming a closed loop for easy issue tracing.

Monitoring of service latency and quality.

Front‑end caching (5‑10 s) via Nginx + Lua to offload traffic from back‑end.

Business‑level pre‑processing (e.g., input validation, illegal data filtering).

A/B testing controlled by Lua scripts based on user IDs.

Gradual rollout using feature switches.

Online stress testing using Lua coroutines to split a request into parallel backend calls.

Service Isolation

Requests are categorized by criticality (e.g., inventory as level‑0, warranty as level‑1) and processed in isolated thread pools to prevent a failure in one service from affecting others. Deployment and group isolation further separate dependencies across departments.

Caching and Traffic Management

Multi‑level caching (local then distributed) with consistent hashing across Nginx instances improves hit rates. High‑traffic services use aggressive caching, while latency‑sensitive data (price, inventory) may bypass cache or employ automatic degradation after configurable timeouts. CDN versioning is used for reviews to reduce origin load.

Monitoring, Logging, and Stress Testing

Comprehensive monitoring tracks instance health, request volume, response time, and availability. Nginx access logs help identify crawlers and malicious traffic. Stress testing combines synthetic URL load and replay of real traffic to evaluate throughput and mixed read/write performance.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend ArchitecturecachingFrontend Optimizationnginx luaservice isolationhigh-trafficProduct Detail Page
21CTO
Written by

21CTO

21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.

0 followers
Reader feedback

How this landed with the community

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.