☁️Huawei Cloud Distributed Cache Service

Elif Meriç
Huawei Developers
Published in
6 min readDec 28, 2023
Huawei Cloud DCS

Introduction

Hi, everyone! In this article, we will talk about Huawei Cloud Distributed Cache Service. Huawei Cloud provides an online, distributed in-memory cache service which supports Redis. We will learn what is Redis and how to use DCS, what are its advantages, application scenarios, etc., so let’s start! Enjoyable readings 😊

What is Redis?

Redis is one of the most-known NoSQL databases. It is open-source and written with C language, so high performance results are obtained. It is known for its high performance, flexibility, and scalability. Redis is often used to store data that needs to be accessed very quickly, such as user sessions, product information, and real-time data. As I said before, it is a NoSQL database, which means that it does not use a relational scheme to store data. Instead, Redis stores data in key-value pairs. This makes Redis very fast and efficient for retrieving data, as you can simply look up a value by its key. Redis is also very scalable and can be used to store large amounts of data. It can be horizontally scaled by adding more servers to a cluster. This makes it a good choice for applications that need to store and access large amounts of data.

What are the advantages of using Redis?

- High Performance: Redis is very fast and can handle millions of requests per second

- Flexibility: Redis can be used for a variety of purposes, including caching, messaging, and real-time data storage.

- Scalability: Redis can be horizontally scaled to store large amounts of data.

What is DCS?

DCS was developed based on open-source Redis, but they are different. It is an online in-memory cache service of Huawei Cloud. Here are the some of the advantages of DCS:

Advantages of DCS

If you need high concurrency and access speeds, you want a solution that is scalable, reliable, easy backups, and easy to manage.

Scaling without interruption

DCS is different from the open-source Redis in the aspects of reliable deployment, overall management, and secure performance.

Quick deployment

Also, DCS provides O&M features, so you can easily perform operations and management for your service.

What are DCS Compatible Redis Versions?

DCS supports:

- Redis 4.0

- Redis 5.0

- Redis basic

- Redis Professional 6.0

What are Redis application scenarios?

1. Gaming Application

- Storing player scores and rankings in leaderboards for real-time updates and global competition.

- Managing game state and player data for fast-paced gameplay and seamless session recovery.

- Implementing real-time chat and messaging for in-game communication and social features.

2. Social Media Platform

- Caching user profiles, posts, and interactions for quick display and reduced database strain.

- Tracking user activity feeds and displaying them in real-time using Redis’s pub/sub capabilities.

- Implementing real-time messaging and chat features for seamless communication between users.

3. E-commerce Platform

- Caching product details, prices, and inventory for fast retrieval and to reduce database load.

- Storing shopping cart data for active users to maintain session continuity and ensure a smooth checkout process.

- Implementing real-time product recommendations and personalized search results based on user activity.

4. Financial Trading Platform

- Caching market data and order books for real-time updates and swift trade execution.

- Implementing risk management systems with fast data access and processing capabilities.

5. IoT applications

- Collecting and processing sensor data in real-time for monitoring, analytics, and device control.

- Managing device state and configuration for large-scale IoT deployments.

6. Healthcare Applications

- Managing patient health records and clinical data for real-time access and decision-making.

- Tracking patient health status and providing timely alerts and notifications.

7. Content Delivery Network (CDN)

- Caching frequently accessed content at the edge of the network to reduce latency and improve user experience.

- Distributing content across multiple servers for high availability and scalability.

Distributed Cache Service Instance Types

a. Single-Node Redis

Single Redis Server: Runs on a single server, offering high performance, low latency, and cost-effectiveness.

No Data Persistence: Data is not automatically persisted to disk, making it suitable for scenarios that prioritize performance and can tolerate data loss upon instance restarts.

High QPS: Supports up to 100,000 QPS (Queries Per Second), ideal for high-concurrency workloads.

No Data Synchronization: Eliminates overhead associated with data synchronization, further boosting performance.

Process Monitoring and Automatic Fault Recovery: Includes a high availability mechanism to automatically restart the Redis process within 30 seconds in case of failures, ensuring service continuity.

Out-of-the-Box Usability: Ready to use immediately, with no data loading required.

Cost-Effective: 40% cheaper than master/standby DCS instances, making it a budget-friendly option for development and testing environments.

Single-Node

Use-cases of Single-Node Redis Instance

- Database Front-End Caching: Accelerates database queries and eases backend load by caching frequently accessed data.

- Session Caching: Stores user session data for fast retrieval and improved web application performance.

- Temporary Data Storage: Holds transient data that doesn’t require long-term persistence.

- Development and Testing Environments: Provides a cost-effective and high-performance option for setting up Redis instances for development and testing purposes.

b. Master/Standby Instances

- High Availability: Achieves high availability through a master-standby architecture, ensuring continuous service even in the event of a node failure.

- Data Persistence: Provides data persistence by default, writing data to disk on both master and standby nodes for durability.

- Automatic Failover: Automatically switches to the standby node within seconds if the master node fails, minimizing service disruptions.

- Data Synchronization: Maintains data consistency between master and standby nodes through real-time replication.

- Scalability: Can be scaled vertically by increasing memory and CPU resources.

Architecture:

Two Redis Nodes: Comprises a master node that handles read and write requests, and a standby node that replicates data from the master in real-time.

Data Synchronization: Employs asynchronous replication to ensure data consistency between nodes.

Failover Process: If the master node fails, the standby node automatically takes over as the new master, promoting data availability.

Use-cases of master/standby Redis structure

Production Environments: Ideal for production environments where data durability and high availability are essential.

Mission-Critical Applications: Suitable for applications that cannot tolerate data loss or downtime, such as financial systems, e-commerce platforms, and healthcare systems.

Scenarios with High Data Consistency Requirements: Ensures data consistency even in the face of node failures.

Master/Standby

Conclusion

In this article, we introduced what is Redis and Huawei Cloud Distributed Cache Service, its application scenarios, advantages, etc. There are many advantages of using cloud such as quick deployment, scalability, reliability, security, etc, so in this direction, using Redis on Huawei Cloud DCS brings us many advantages.

References

--

--