Redis Hotspot Key Discovery and Common Solutions

Common Causes of Hotspot Keys

Impact of the Hotspot Key Problem

  1. Traffic is concentrated, reaching the upper limit of the physical network adapter.
  2. Too many requests queue up, crashing the sharding service of the cache.
  3. The database is overloaded, resulting in a service avalanche.

Recommended Solutions

Server Cache Solution

  1. Cache building problem of the multi-thread service when the cache fails
  2. Cache building problem when the cache is missing
  3. Dirty reading problem

“MemCache + Redis” Solution

  1. Wasted memory resources
  2. Dirty reading problem

Local Cache Solution

  1. Hotspots must be detected in advance.
  2. The cache capacity is limited.
  3. The inconsistency duration is long.
  4. Hotspot keys are incomplete.

Read/Write Splitting Solution

  1. Load balancing is implemented at the SLB layer.
  2. Read/Write separation and automatic routing are implemented at the proxy layer.
  3. Write requests are processed by the master node.
  4. Read requests are processed by the read-only node.
  5. HA is implemented on the slave and master nodes.

Hotspot Data Solution

  1. The proxy locally caches the hotspot data, and its reading capability is horizontally scalable.
  2. The database node regularly calculates the hotspot data set.
  3. The database feeds the hotspot data back to the proxy.
  4. The proxy architecture is completely transparent to the client, making efforts to impose compatibility unnecessary.

Processing of Hotspot Keys

Reading of the Hotspot Data

Discovery of Hotspot Data

  1. Hotspot statistics based on statistical thresholds.
  2. Hotspot statistics based on the statistical cycle.
  3. Statistics collection method based on the version number, which does not require resetting the initial value when being used.
  4. Calculating hotspots on the database features minimal performance impacts and lightweight memory occupation.

Comparison of Solutions




Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Packages in Java: How to Create and Use Packages in Java?

PouchContainer RingBuffer Log Practices

Cold Disaster recovery on Google Cloud for applications running on-premises

3 Principles To Help Maintain Code Quality While Implementing New Product Features.

Rockset Is Up to 9.4x Faster than Apache Druid on the Star Schema Benchmark

How do you use System.Drawing in NativeAOT?

Drafting another life tale…

Summer Sprint: Q&A with Ro Engineering Fellows of 2021

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:

More from Medium

Stream avro data from kafka over ssl to Apache pinot

Mocking GCP DatastoreRepository::performTransaction with MockK

Distributed transactions spanning multiple databases with Scalar DB (Part 1)

Log Management in Microservices