Hotkey Detection Framework for JD App Backend
JD’s hot‑key detection framework instantly identifies bursty hot requests, pushes the hot keys to a clustered memory layer, and broadcasts them to all JVMs, enabling client‑side caching, user blocking, and circuit breaking, while handling up to 370 000 detections and 800 000 pushes per second and reducing backend query load by over 50 % in large‑scale events.
JD App backend middleware detects hot data in milliseconds and pushes the hot keys to server cluster memory, greatly reducing query pressure on the data layer.
The framework can precisely detect bursty hot requests—such as massive requests for a single product, hot users (bots, scrapers), or hot interfaces—and broadcast the hot keys to all JVMs in the application cluster, enabling client‑side caching, user blocking, or circuit breaking.
Performance metrics: On an 8‑core worker, the system processes up to 160,000 detection tasks per second; a 16‑core worker handles over 300,000 tasks per second, with peak tests reaching 370,000. Push throughput is stable at 100,000–120,000 pushes per second, and can sustain 400,000–600,000 pushes per second under pure push load, with a peak of 800,000 pushes for a few seconds. For example, 100 hot keys generated by one worker on 1,000 servers result in 100 * 1000 = 10 万 pushes per second.
In real‑world high‑traffic events (2020 JD 618 and Double‑11), the framework processed billions of hot keys daily, captured many bot users, and reduced backend query load, with hot‑key‑driven local caching covering over 50% of total traffic.
Architecture: The solution consists of four parts: an etcd cluster for configuration and hot‑key storage, a client‑side JAR for key reporting and local caching, a worker cluster that aggregates key statistics and pushes hot keys, and a dashboard console for rule management and manual hot‑key handling.
Project repository: https://gitee.com/jd-platform-opensource/hotkey
Java Tech Enthusiast
Sharing computer programming language knowledge, focusing on Java fundamentals, data structures, related tools, Spring Cloud, IntelliJ IDEA... Book giveaways, red‑packet rewards and other perks await!
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.