Help Center/ Distributed Cache Service/ FAQs/ Feature/ Do DCS Redis Instances Support Data Persistence? What Is the Impact of Persistence?
Updated on 2024-09-24 GMT+08:00

Do DCS Redis Instances Support Data Persistence? What Is the Impact of Persistence?

Is Persistence Supported?

Single-node: No

Master/Standby, read/write splitting, and cluster (except single-replica clusters): Yes

How Is Data Persisted?

  • DCS Redis instances supports only AOF persistence by default. You can enable or disable persistence as required. All instances except single-node and single-replica cluster ones are created with AOF persistence enabled.
  • DCS Redis instances do not support RDB persistence by default and the save parameter cannot be manually configured. If RDB persistence is required for a master/standby or cluster instance of Redis 4.0 or later, you can use the backup and restoration function to back up the instance data in an RDB file and store the data in OBS.

Disk Used for Persistence

For DCS Redis 4.0 and later instances, data is persisted to SSD disks.

Impact of AOF Persistence

After AOF persistence is enabled, the Redis-Server process records operations in the AOF file for data persistence. This may have the following impacts:
  • If the disk or I/O of the underlying compute node is faulty, the latency may increase or a master/standby switchover may occur.
  • Redis-Server periodically rewrites the AOF. During a rewrite, the latency may be high for a short time. For details about the AOF rewriting rules, see When Will AOF Rewrites Be Triggered?

If DCS instances are used for application acceleration, you are advised to disable AOF persistence for higher performance and stability.

Exercise caution when disabling AOF persistence. After it is disabled, cached data may be lost in extreme scenarios, for example, when both the master and standby nodes are faulty.

Configuring Redis Persistence

Set the instance configuration parameter appendonly to no to disable, or yes to enable AOF persistence. (Not available for single-node instances.)

For details, see Modifying Configuration Parameters of an Instance.

DCS for Redis: Can I Enable Persistence Only on Replicas and Not on Masters?

Yes. For a master/standby or cluster DCS Redis 4.0/5.0/6.0 basic instance, or a master/standby professional (performance) instance, you can set the appendonly parameter to only-replica to enable persistence only on replicas.

This function is not available for other instance versions or types.

  • By default, the appendonly parameter has only two options: yes and no. To set it to only-replica, contact O&M personnel.
  • Without writing and rewriting AOF on the master node, persistence only on replicas improves performance but lowers reliability, compared with persistence on both master and replica nodes. Select a mode based on service requirements.