Updated on 2023-09-08 GMT+08:00

Common Practices

This section describes common practices of DCS to help you better use it.

Practice

Description

Serializing Access to Frequently Accessed Resources

In Internet scenarios such as seckill, the system needs multiple machines to run concurrently to handle traffic burst. Assume that two users' requests arrive at the same time but on different machines. Although the two requests can be handled spontaneously, an inventory oversold or disordered access problem may still occur. This is because a machine's lock only takes effect on threads in the Java VM where the machine runs. To serialize access to resources, you can use DCS Redis instances for distributed locking.

Using Nginx for Public Access to Redis

By default, public network access is not supported for Redis 4.0 and later versions. This practice describes how to access a DCS Redis instance in the VPC through a jump server over public network.

Connecting a Redis Client to DCS Through CCE

More and more applications are deployed in containers. This practice describes how to deploy Redis clients in Cloud Container Engine (CCE)'s cluster container to access DCS through CCE.