Understanding Cache Challenges and Solutions with Tencent Cloud Redis Hybrid Storage
The article outlines common cache challenges—consistency, breakdown, and avalanche—explains traditional three‑tier architectures, then details Tencent Cloud Redis Hybrid Storage’s unified interface, automatic hot‑data caching, dynamic TTL, atomic updates, and cost‑effective persistence, offering a scalable, reliable cache‑plus‑storage solution.
This article summarizes a presentation by Tencent Cloud senior product manager Zou Peng on the architecture and challenges of cache‑plus‑storage systems, and introduces the Tencent Cloud Redis Hybrid Storage product that integrates caching and persistent storage.
Background : Modern web and mobile applications generate massive data volumes, requiring fast access (cache) and reliable persistence (storage). Introducing distributed cache adds complexity such as cache consistency, cache breakdown (penetration), and cache avalanche.
Cache Challenges
1. Cache Consistency : Updating both the storage and the cache must handle isolation and atomicity across distributed systems. Most businesses sacrifice a small probability of inconsistency for performance.
2. Cache Breakdown (Penetration) : When a request misses the cache and floods the DB, the system can be overloaded. Causes include empty‑data queries and cache pollution. Mitigation methods include using Bloom filters to filter non‑existent keys and storing negative cache entries.
3. Cache Avalanche : Simultaneous expiration of many hot keys or a sudden surge of cold‑key accesses can cause massive DB load. Common mitigation is adding random jitter to TTLs.
Traditional Distributed Cache Solutions
Typical stacks use a three‑layer architecture (application → cache → storage). Cache components include Memcached or Redis; storage may be MySQL, PostgreSQL, Oracle, SQL Server, MongoDB, HBase, etc.
Cache Operations in the Hybrid Model
Cache Read : Application first reads from cache; on miss, it reads from storage and populates the cache. Example code:
# Python
def get_user(user_id):
# Check the cache
record = cache.get(user_id)
if record is None:
# Run a DB query
record = db.query("select * from users where id=?", user_id)
# Populate the cache
cache.set(user_id, record)
return record
# App code
user = get_user(17)Cache Update : Two main patterns – business‑layer update and external‑component update. Business‑layer update can be lazy (delete cache, let next read repopulate) or proactive (write new value to cache). The hybrid product provides atomicity guarantees via revision numbers and supports both serial and parallel updates.
Cache Eviction : Active eviction (TTL‑based) is recommended; passive eviction uses Redis maxmemory policies when memory is exhausted.
Tencent Cloud Redis Hybrid Storage Product
The product combines a Proxy, a Redis cache layer, and a Tendis storage engine (RocksDB‑based). It offers:
Unified Redis‑compatible interface.
Automatic hot‑data caching and cold‑data offloading.
Dynamic TTL to prevent cache avalanche.
High read/write throughput (up to 1 M concurrent writes, 10 M reads).
Cost reduction up to 85% compared with pure‑memory solutions.
Support for PB‑level KV storage, horizontal/vertical scaling, and disaster‑recovery.
Key features include consistent cache‑storage synchronization, built‑in Bloom‑filter‑like empty‑key handling, versioned data (revision) for read‑consistency, and configurable durability modes (performance‑first asynchronous vs. strong‑consistency synchronous).
Selected Q&A Highlights
• Recruitment: Candidates familiar with Redis are welcomed (email provided).
• Pricing: Public‑cloud offering with up to 85% cost savings; open‑source plans are under consideration.
• Resource consumption: Hybrid storage adds modest CPU overhead for compression and compaction; memory usage is lower than pure‑memory Redis.
• Reliability: Two durability modes – async (performance‑first) and sync (strong consistency). In async mode, a Redis crash before persisting to Tendis may lose recent writes, similar to MySQL async replication.
• Deployment: Not based on Kubernetes; accessed via a VIP. Supports multi‑AZ and future global multi‑active deployments.
• Use cases: Ideal for KV workloads that need caching plus durable storage (e.g., Redis + MySQL patterns). Not recommended for pure cache or compute‑intensive workloads.
Overall, the article provides a technical overview of cache‑related problems, concrete mitigation strategies, and an in‑depth introduction to Tencent Cloud’s Redis Hybrid Storage solution.
Tencent Cloud Developer
Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.
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.