Product Introduction · Redis and Memcached DCS instances can quickly scale online as instance load...
Transcript of Product Introduction · Redis and Memcached DCS instances can quickly scale online as instance load...
Distributed Cache Service
Product Introduction
Issue 01
Date 2018-10-18
Contents
1 Overview......................................................................................................................................... 1
2 Functions......................................................................................................................................... 3
3 Application Scenarios...................................................................................................................5
4 DCS Instance Specifications....................................................................................................... 7
5 Usage Restrictions....................................................................................................................... 12
6 Command Compatibility........................................................................................................... 146.1 Redis Commands..........................................................................................................................................................146.2 Memcached Commands............................................................................................................................................... 186.3 IMDG Commands........................................................................................................................................................ 23
7 Basic Concepts..............................................................................................................................25
8 Change History............................................................................................................................ 27
Distributed Cache ServiceProduct Introduction Contents
Issue 01 (2018-10-18) ii
1 Overview
Distributed Cache Service (DCS) is an online, distributed, in-memory cache servicecompatible with Redis, Memcached, and in-memory data grid (IMDG). It is reliable, scalable,usable out of the box, and easy to manage.
l Redis: a storage system that supports multiple types of data structures, including key-value pairs. It can be used in scenarios such as caching, event pub/sub, and high-speedqueuing. Redis is networked and written in ANSI C. It supports direct read/write ofstrings, hashes, lists, queues, and sets. Redis works with in-memory datasets andprovides persistence. For more information about Redis, visit https://redis.io/.
l Memcached: an in-memory key-value caching system that supports read/write of simplestrings. It is commonly used to accelerate web applications by caching content of back-end databases to alleviate load on back-end databases. In addition to full compatibilitywith Memcached, DCS provides the master/standby instance type and data persistence.For more information about Memcached, visit https://memcached.org/.
l IMDG: an in-memory database that uses key-value pairs. IMDGs provide high-performance data organization and management between applications and different datasources based on distributed memory.The IMDGs that DCS uses are industry-leadingmemory computing platform GridGain and open-source platform Apache Ignite. TheseIMDGs enable DCS to provide distributed cache, SQL query, computing, and transactionprocessing capabilities, and are fully compatible with standard JCache (JSR107) andSQL ANSI-99 access interfaces.– For more information about GridGain, visit https://www.gridgain.com.– For more information about Ignite, visit https://ignite.apache.org.
NOTE
IMDG is supported only in some regions. The DCS console prevails.
Distributed Cache ServiceProduct Introduction 1 Overview
Issue 01 (2018-10-18) 1
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 1 Overview
Issue 01 (2018-10-18) 2
2 Functions
This section describes the DCS functions, including instance types, capacity specifications,and instance management functions.
DCS supports single-node, master/standby, and cluster instances, ensuring high read/writeperformance and fast data access. In addition, DCS supports various instance managementoperations, facilitating users' O&M. Therefore, DCS users need to focus only on the servicelogic without the need to care about the deployment, monitoring, scaling, security, andtroubleshooting issues.
High Availability
DCS monitors instance status in real time. When a master cache node becomes faulty, thestandby cache node will take over within seconds.
l For DCS instances of master/standby type, the instance status is monitored in real time.DCS clients will not perceive the failover because the instance IP address exposed tothem remains unchanged.
l For DCS instances of cluster type, each shard is held on both master and standby cachenodes. DCS clients will not perceive the failover because the instance IP address exposedto them remains unchanged.
Various Capacity Specifications
Various capacity specifications are provided. Each DCS instance of single-node or master/standby type provides 2 GB to 64 GB, and each DCS instance of cluster type provides 64 GBto 1024 GB.
Scalability
Redis and Memcached DCS instances can quickly scale online as instance load increases,without affecting upper-layer services.
High Data Reliability
Redis and Memcached DCS instances support data persistence, backup, and restoration.
Distributed Cache ServiceProduct Introduction 2 Functions
Issue 01 (2018-10-18) 3
SecuritySecurity measures include user identity authentication, VPCs, subnets, security groups, andaudit logs.
Metric MonitoringYou can view over 30 metrics and customize alarm thresholds and policies.
l Rich metrics– External metrics include the number of commands, concurrent operations,
connections, clients, and denied connections.– Resource usage metrics include CPU usage, physical memory usage, network input
throughput, and network output throughput.– Internal metrics include instance capacity usage, as well as the number of keys,
expired keys, PubSub channels, PubSub patterns, keyspace hits, and keyspacemisses.
l Custom alarm thresholds and policiesFor example, if you suspect a service fault was caused by frequent keyspace misses, thenyou can set the keyspace miss threshold to 30 and specify the user who will receive thethreshold crossing alert. When the number of keyspace misses reaches 30, the user willreceive an alert.
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 2 Functions
Issue 01 (2018-10-18) 4
3 Application Scenarios
DCS is used in various application scenarios for web page caching, application caching, statuscaching, and concurrent event processing.
For e-commerce, video sharing, gaming, and other data-intensive applications, it is essentialto retrieve data fast. The primary purpose of DCS is to provide fast yet inexpensive access todata. With DCS, you can retrieve data from fast, in-memory data stores instead of relyingentirely on slower disk-based databases. DCS instances are fully managed. You no longerneed to perform management tasks such as hardware provisioning, software patching,monitoring, and failure recovery. DCS, as an important supplement to traditional disk-baseddatabases, is a basic service essential for Internet applications receiving high-concurrencyaccess.
Web PagesIf the Redis or Memcached engine is used, caching the content of web pages improves pageload times. The cached content can include static data such as Hypertext Markup Language(HTML) pages, Cascading Style Sheets (CSS), and images.
StatusIf the Redis or Memcached engine is used, DCS provides quick and simple queries of sessionstatus and application-scaling status, enabling easy sharing of status information.
Application ObjectsRedis or Memcached serves as a level-2 cache at the service layer to provide data store andaccess for external entities. Storing frequently requested data into DCS instances can ease theload off databases and reduce access latency.
EventsIf the Redis engine is used, DCS provides continuous event querying, allowing streams ofevents to be processed as they occur.
Support for Standard SQL InterfacesIMDG uses high-performance cache to store data and supports standard SQL interfaces fordata access.
Distributed Cache ServiceProduct Introduction 3 Application Scenarios
Issue 01 (2018-10-18) 5
In-memory Data Collection and ComputingIMDG supports direct in-memory data collection and computing.
NOTE
IMDG is supported only in some regions. The DCS console prevails.
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 3 Application Scenarios
Issue 01 (2018-10-18) 6
4 DCS Instance Specifications
This section describes the specifications of DCS Redis, Memcached, IMDG, and DCS2.0Redis instances.
NOTE
l DCS Redis instances are classified into single-node, master/standby, and cluster types. DCSMemcached instances are classified into single-node and master/standby types. DCS IMDGinstances are classified into single-node and cluster types. DCS2.0 and IMDG are supported only insome regions. The DCS console prevails.
l The maximum intranet bandwidth is the sum of maximum inbound and outbound intranetbandwidths. Usually, DCS instances are read more frequently than they are written. Therefore, it isrecommended that the maximum inbound intranet bandwidth be one third of the maximum intranetbandwidth and the maximum outbound intranet bandwidth be two thirds of the maximum intranetbandwidth.
Redis Instance
For each single-node DCS Redis instance, the available memory is less than the total memorybecause some memory is reserved for system overhead.
For each master/standby DCS Redis instance, the available memory is less than the totalmemory because some memory is reserved for data persistence. The available memory of amaster/standby instance can be adjusted to support background tasks such as data persistenceand master/standby synchronization.
Table 4-1 Specifications of single-node and master/standby DCS Redis instances
TotalMemory(GB)
AvailableMemory(GB)
MaximumNumber ofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
2 1.5 10,000 400
4 3.2 10,000 400
8 6.8 10,000 1520
16 13.6 10,000 3040
Distributed Cache ServiceProduct Introduction 4 DCS Instance Specifications
Issue 01 (2018-10-18) 7
TotalMemory(GB)
AvailableMemory(GB)
MaximumNumber ofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
32 27.2 10,000 3040
64 58.2 20,000 3040
Table 4-2 Specifications of cluster DCS Redis instances
Specification(GB)
AvailableMemory(GB)
Maximum NumberofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
64 64 20,000 2000
128 128 20,000 2000
256 256 20,000 2000
512 512 20,000 2000
1024 1024 20,000 2000
NOTE
l The used memory of a cluster instance is the sum of used memory of each node. Therefore, the usedmemory of the instance may be slightly greater than its available memory.
l Cluster DCS Redis instances billed in pay-per-use mode support 64 GB, 128 GB, and 256 GB.Cluster DCS Redis instances billed in yearly/monthly mode support 64 GB, 128 GB, 256 GB, 512GB, and 1024 GB.
Memcached InstanceFor each single-node DCS Memcached instance, the available memory is less than the totalmemory because some memory is reserved for system overhead.
For each master/standby DCS Memcached instance, the available memory is less than thetotal memory because some memory is reserved for data persistence. The available memoryof a master/standby instance can be adjusted to support background tasks such as datapersistence and master/standby synchronization.
Distributed Cache ServiceProduct Introduction 4 DCS Instance Specifications
Issue 01 (2018-10-18) 8
Table 4-3 Specifications of single-node DCS Memcached instances
TotalMemory(GB)
AvailableMemory(GB)
Maximum NumberofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
2 1.5 10,000 128
4 3.2 10,000 192
8 6.8 10,000 192
16 13.6 10,000 256
32 27.2 10,000 256
64 58.2 12,000 384
Table 4-4 Specifications of master/standby DCS Memcached instances
TotalMemory(GB)
AvailableMemory(GB)
MaximumNumber ofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
2 1.5 10,000 128
4 3.2 10,000 192
8 6.4 10,000 192
16 12.8 10,000 256
32 25.6 10,000 256
64 51.2 12,000 384
IMDG InstanceFor each single-node DCS IMDG instance, the available memory is less than the totalmemory because some memory is reserved for system overhead.
Table 4-5 Specifications of single-node DCS IMDG instances
Total Memory (GB) Available Memory (GB)
2 1.5
4 3.0
8 6.5
Distributed Cache ServiceProduct Introduction 4 DCS Instance Specifications
Issue 01 (2018-10-18) 9
Specifications of cluster DCS IMDG instances are listed in Table 4-6.
NOTE
The used memory of a cluster instance is the sum of used memory of each node. Therefore, the usedmemory of the instance may be slightly greater than its available memory.
Table 4-6 Specifications of cluster DCS IMDG instances
Specification (GB) Available Memory (GB)
16 13
DCS2.0 Redis InstanceAvailable memory of DCS2.0 instances is the same as their specifications, as shown in Table4-7, Table 4-8, and Table 4-9.
NOTE
l Before creating a DCS2.0 instance with memory size greater than 8 GB, submit a service ticket.
l If the instance specification exceeds your available quota, submit a service ticket to increase yourquota.
Table 4-7 Specifications of single-node DCS2.0 Redis instances
Total Memory Available Memory MaximumNumber ofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
128 MB 128 MB 500 32
256 MB 256 MB 500 32
512 MB 512 MB 500 32
1–3 GB (with anincrement of 1 GB)
1–3 GB (with anincrement of 1 GB)
10,000 128
4–15 GB (with anincrement of 1 GB)
4–15 GB (with anincrement of 1 GB)
10,000 192
16–48 GB (with anincrement of 1 GB)
16–48 GB (with anincrement of 1 GB)
10,000 256
49–64 GB (with anincrement of 1 GB)
49–64 GB (with anincrement of 1 GB)
12,000 384
Distributed Cache ServiceProduct Introduction 4 DCS Instance Specifications
Issue 01 (2018-10-18) 10
Table 4-8 Specifications of master/standby DCS2.0 Redis instances
Total Memory(GB)
Available Memory(GB)
MaximumNumber ofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
1–3 GB (with anincrement of 1 GB)
1–3 GB (with anincrement of 1 GB)
10,000 128
4–15 GB (with anincrement of 1 GB)
4–15 GB (with anincrement of 1 GB)
10,000 192
16–48 GB (with anincrement of 1 GB)
16–48 GB (with anincrement of 1 GB)
10,000 256
49–64 GB (with anincrement of 1 GB)
49–64 GB (with anincrement of 1 GB)
12,000 384
Table 4-9 Specifications of cluster DCS2.0 Redis instances
Total Memory(GB)
Available Memory(GB)
MaximumNumber ofConnectionsAllowed
Maximum IntranetBandwidth(Mbit/s)
64 64 160,000 3072
128 128 320,000 6144
256 256 640,000 12,288
512 512 640,000 12,288
1024 1024 640,000 12,288
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 4 DCS Instance Specifications
Issue 01 (2018-10-18) 11
5 Usage Restrictions
Accountl An account can create a DCS instance only after passing the real-name authentication.l By default, you can create a maximum of 5 DCS instances with the total memory not
exceeding 400 GB. To create more DCS instances, submit a service ticket.
RegionCurrently, DCS is available in AP-Hong KongCN, South-Guangzhou, CN North-Beijing1,and CN East-Shanghai2.
SpecificationsCurrently, you cannot create a DCS instance less than 2 GB.
NetworkA public cloud uses VPCs to manage the network security of each service.
l Your client must be deployed on an ECS that belongs to the same VPC as a DCSinstance of the Redis or Memcached type.
l For a DCS IMDG instance, the VPC and subnet for the ECS where your client isdeployed must be the same as those for the DCS instance to ensure network connectivitybetween the ECS and DCS instance.
l You are advised to select the same security group for a DCS instance and the ECS whereyour client is deployed. If the DCS instance and ECS belong to different security groups,add inbound and outbound rules for the security groups. For more information on how toadd the rules, see How to Select and Configure a Security Group? in DCS FAQs.
ScalingYou can scale out an instance only within the remaining quota scope. If your quota isinsufficient, submit a service ticket to increase the quota.
Distributed Cache ServiceProduct Introduction 5 Usage Restrictions
Issue 01 (2018-10-18) 12
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 5 Usage Restrictions
Issue 01 (2018-10-18) 13
6 Command Compatibility
6.1 Redis CommandsThis section describes DCS's compatibility with Redis commands, including supportedcommands, disabled commands, unsupported scripts and commands of later Redis versions,and restrictions on command usage.
6.2 Memcached CommandsThis section describes the commands supported by the DCS Memcached text protocol andMemcached binary protocol.
6.3 IMDG CommandsThis section describes the standard interfaces compatible with DCS IMDG.
6.1 Redis CommandsThis section describes DCS's compatibility with Redis commands, including supportedcommands, disabled commands, unsupported scripts and commands of later Redis versions,and restrictions on command usage.
Supported Redis CommandsThe DCS Redis engine supports the majority of commands of Redis 3.0.7 and earlierversions. Any clients that support Redis can access DCS. For security purposes, certain Rediscommands are disabled in DCS, which are listed in Disabled Redis Commands. Some Rediscommands have usage restrictions, which are described in Redis Command UsageRestrictions.
DCS supports the GEO command of Redis 3.2. However, DCS does not support certaincommands and scripts added in Redis 3.2 and 4.0, which are listed in Commands andScripts That Are Added in Later Redis Versions but Not Supported by DCS.
Table 6-1 lists the commands supported by cluster DCS instances for multi-key operations inthe same slot.
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 14
Table 6-1 Commands supported by cluster DCS instances for multi-key operations in thesame slot
Category Commands
Set SINTERSTORE, SINTER, SUNIONSTORE, SUNION,SDIFFSTORE, SDIFF, SMOVE
SortedSet ZUNIONSTORE, ZINTERSTORE
HyperLogLog PFCOUNT, PFMERGE
List BLPOP, BRPOP, BRPOPLPUSH
Keys RENAME, RENAMENX, BITOP, RPOPLPUSH
String MSETNX
Disabled Redis Commands
Redis APIs of single-node and master/standby DCS instances are completely compatible withopen-source Redis in terms of data access. For ease of use and security purposes, somemanagement operations cannot be initiated from a Redis client, which are listed in Table 6-2.Cluster DCS instances do not support the commands listed in Table 6-3 in addition to thecommands disabled in single-node and master/standby DCS instances.
Table 6-2 Redis commands disabled in single-node and master/standby DCS instances
Category Commands
Keys MIGRATE
Server SLOWLOG, SLAVEOF, SHUTDOWN, SAVE, MONITOR,LASTSAVE, DEBUG SEGFAULT, DEBUG OBJECT, CONFIG SET,CONFIG REWRITE, CONFIG RESETSTAT, COMMAND INFO,COMMAND GETKEYS, COMMAND COUNT, COMMAND,BGSAVE, BGREWRITEAOF
Table 6-3 Redis commands disabled in cluster DCS instances
Category Commands
Server SYNC, PSYNC
Script SCRIPT DEBUG
Transaction DISCARD, EXEC, MULTI, UNWATCH, WATCH
Connection SELECTNOTE
Parameters of the SELECT command can only be set to 0.
Keys MOVE, RESTORE
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 15
Category Commands
Cluster CLUSTER
codis PSUBSCRIBE(), PUBLISH, PUNSUBSCRIBE, SUBSCRIBE,RANDOMKEY, UNSUBSCRIBE, TIME, SLOTSINFO, SLOTSDEL,SLOTSMGRTSLOT, SLOTSMGRTONE, SLOTSCHECK,SLOTSMGRTTAGSLOT, SLOTSMGRTTAGONE
Redis clients receive "(error) ERR unknown command" from DCS and probably exhibitunpredictable behavior after running the disabled commands. DCS cannot control theirbehavior. For example, if the MONITOR command is run, redis-cli will keep waiting formonitoring results even after receiving "(error) ERR unknown command" from DCS andrefuse to run other commands during the wait period.
Commands and Scripts That Are Added in Later Redis Versions but NotSupported by DCS
Table 6-4 Commands and scripts that are added in later Redis versions but not supported byDCS
Command/Script Description
SPOP Command used to control the number of randomly deletedelements. This command is added in Redis 3.2. Parameternot supported: count.
HSTRLEN Command used to return the value length of hash data.This command is added in Redis 3.2.
BITFIELD Command used to calculate character strings as arrays ofbinary digits. This command is added in Redis 3.2.
SWAPDB Command used to exchange the two databases specified ina DCS Redis instance. This command is added in Redis4.0.
MEMORY Command used to query and manage the memory usage,for example, query the memory usage of a key, query thedetails of overall memory usage, apply for memoryrelease, query the internal status of a memory allocator.This command is added in Redis 4.0.
Redis Command Usage RestrictionsKey commands:
When a KEYS command is run, execution of other service commands may be blocked for along time or even extra high memory may be occupied in case of a large amount of cached
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 16
data. Therefore, when running a KEYS command, describe the exact pattern and do not usefuzzy keys *. keys * can be used during commissioning or when the number of keys does notexceed 5 million. Otherwise, the service cannot run properly.
Server commands:
l Some Redis commands, such as FLUSHALL, take a long time to run. While runningthese commands, DCS instances may not respond to other commands and change to thefaulty state. However, after the command finishes executing, the instance will return tonormal.
l When the FLUSHDB or FLUSHALL command is run, execution of other servicecommands may be blocked for a long time in case of a large amount of cached data.
EVAL and EVALSHA commands:
l When running EVAL and EVALSHA commands, ensure that the command parameterscontain at least one key. Otherwise, the client displays the error message "ERR eval/evalsha numkeys must be bigger than zero in redis cluster mode."
l When the EVAL or EVALSHA command is run, a DCS Redis cluster uses the first keyto compute slots. Ensure that the keys to be operated in your code are in the same slot.For details, visit http://redis.io/commands.
l For the EVAL command:– You are advised to learn the Lua script feature of Redis before running the EVAL
command.– The execution timeout time of a Lua script is 5 seconds. Time-consuming
statements such as long-time sleep and large loop statements should be avoided.– When calling a Lua script, do not use random functions to specify keys. Otherwise,
the execution results are inconsistent on the master and standby nodes.
Others:
l The time limit for executing a Redis command is 1 minute. After the execution of acommand times out, your client will be automatically disconnected from the server.
l Redis cluster instances purchased before July 10, 2018 must be upgraded to support thefollowing commands:SINTER, SDIFF, SUNION, PFCOUNT, PFMERGE, SINTERSTORE,SUNIONSTORE, SDIFFSTORE, SMOVE, BLPOP, BRPOP, BRPOPLPUSH,ZUNIONSTORE, ZINTERSTORE, EVAL, EVALSHA, BITOP, RENAME,RENAMENX, RPOPLPUSH, MSETNX, SCRIPT LOAD, SCRIPT KILL, SCRIPTEXISTS, SCRIPT FLUSH.
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 17
Related Products and Documents
Product Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
6.2 Memcached CommandsThis section describes the commands supported by the DCS Memcached text protocol andMemcached binary protocol.
The DCS Memcached engine supports the TCP-based Memcached text protocol andMemcached binary protocol. Any clients compatible with a Memcached protocol can accessDCS instances.
Memcached Text Protocol
The Memcached text protocol uses ASCII text to transfer commands, which helps youcompile clients and debug problems. DCS Memcached instances can even be directlyconnected using Telnet.
Compared with the Memcached binary protocol, the Memcached text protocol is compatiblewith more open-source clients, but the text protocol does not support authentication.
NOTE
Clients can use the Memcached text protocol to access DCS Memcached instances only if password-freeaccess is enabled. Password-free access means that access to DCS Memcached instances will not beusername-protected or password-protected, and any Memcached clients that satisfy security group rulesin the same VPC can access the instances. Enabling password-free access poses security risks.Therefore, exercise caution when enabling it.
Table 6-5 lists the commands supported by the Memcached text protocol and describeswhether these commands are supported by DCS Memcached instances.
Table 6-5 Commands supported by the Memcached text protocol
Command Description Supported by DCS
add Add data. Yes
set Set data, including adding ormodifying data.
Yes
replace Replace data. Yes
append Add data after the value of thespecified key.
Yes
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 18
Command Description Supported by DCS
prepend Add data before the value of aspecified key.
Yes
cas Check and set data. Yes
get Query data. Yes
gets Query data details. Yes
delete Delete data. Yes
incr Add the specified amount to therequested counter.
Yes
decr Remove the specified amount to therequested counter.
Yes
touch Update the expiration time of existingdata.
Yes
quit Close the connection. Yes
flush_all Invalidate all existing data. YesNOTE
The value of the delayoption (if any) must be 0.
version Query Memcached versioninformation.
Yes
stats Manage operation statistics. YesNOTE
Currently, only basicstatistics can be queried.Commands on optionalparameters cannot bequeried.
cache_memlimit Adjust the cache memory limit. No
slabs Query usage of internal storagestructures.
No
lru Manage policies of deleting expireddata.
No
lru_crawler Manage threads of deleting expireddata.
No
verbosity Set the verbosity level of the loggingoutput.
No
watch Inspect what's going on internally. No
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 19
Memcached Binary Protocol
The Memcached binary protocol encodes commands and operations into specific structuresbefore sending them. Commands are represented by predefined character strings.
The Memcached binary protocol provides more features but fewer clients than theMemcached text protocol. The Memcached binary protocol is more secure than theMemcached text protocol as it additionally supports simple authentication and security layer(SASL) authentication.
Table 6-6 lists the commands supported by the Memcached binary protocol and describeswhether these commands are supported by DCS Memcached instances.
Table 6-6 Commands supported by the Memcached binary protocol
Command Code
Command Description Supported by DCS
0x00 GET Query data. Yes
0x01 SET Set data, including adding ormodifying data.
Yes
0x02 ADD Add data. Yes
0x03 REPLACE Replace data. Yes
0x04 DELETE Delete data. Yes
0x05 INCREMENT
Add the specified amount to therequested counter.
Yes
0x06 DECREMENT
Remove the specified amount tothe requested counter.
Yes
0x07 QUIT Close the connection. Yes
0x08 FLUSH Invalidate all existing data. YesNOTE
The value of the delayoption (if any) must be 0.
0x09 GETQ Query data. The client will notreceive any response in case offailure.
Yes
0x0a NOOP No-operation instruction,equivalent to ping.
Yes
0x0b VERSION Query Memcached versioninformation.
Yes
0x0c GETK Query data and add a key intothe response packet.
Yes
0x0d GETKQ Query data and return a key. Theclient will not receive anyresponse in case of failure.
Yes
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 20
Command Code
Command Description Supported by DCS
0x0e APPEND Add data after the value of thespecified key.
Yes
0x0f PREPEND Add data before the value of aspecified key.
Yes
0x10 STAT Query statistics of DCSMemcached instances.
YesNOTE
Currently, only basicstatistics can be queried.Commands on optionalparameters cannot bequeried.
0x11 SETQ Set data, including adding ormodifying data.The SETQ command onlyreturns a response on failures.The client will not receive anyresponse in the case of success.
Yes
0x12 ADDQ Add data.Unlike the ADD command, theADDQ command only returns aresponse on failures. The clientwill not receive any response inthe case of success.
Yes
0x13 REPLACEQ Replace data.Unlike the REPLACEcommand, the REPLACEQcommand only returns aresponse on failures. The clientwill not receive any response inthe case of success.
Yes
0x14 DELETEQ Delete data.Unlike the DELETE command,the DELETEQ command onlyreturns a response on failures.The client will not receive anyresponse in the case of success.
Yes
0x15 INCREMENTQ
Add the specified amount to therequested counter.Unlike the INCREMENTcommand, the INCREMENTQcommand only returns aresponse on failures. The clientwill not receive any response inthe case of success.
Yes
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 21
Command Code
Command Description Supported by DCS
0x16 DECREMENTQ
Remove the specified amount tothe requested counter.Unlike the DECREMENTcommand, the DECREMENTQcommand only returns aresponse on failures. The clientwill not receive any response inthe case of success.
Yes
0x17 QUITQ Close the connection. Yes
0x18 FLUSHQ Clear data and return noinformation.
YesNOTE
The value of the delayoption (if any) must be 0.
0x19 APPENDQ Add data after the value of thespecified key.Unlike the APPEND command,the APPENDQ command onlyreturns a response on failures.The client will not receive anyresponse in the case of success.
Yes
0x1a PREPENDQ Add data before the value of aspecified key.Unlike the PREPENDcommand, the PREPENDQcommand only returns aresponse on failures. The clientwill not receive any response inthe case of success.
Yes
0x1c TOUCH Update the expiration time ofexisting data.
Yes
0x1d GAT Query data and update theexpiration time of existing data.
Yes
0x1e GATQ Query data and return a key. Theclient will not receive anyresponse in case of failure.
Yes
0x23 GATK Query data, add a key into theresponse packet, and update theexpiration time of existing data.
Yes
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 22
Command Code
Command Description Supported by DCS
0x24 GATKQ Query data, return a key, andupdate the expiration time ofexisting data. The client will notreceive any response in case offailure.
Yes
0x20 SASL_LIST_MECHS
Ask the server what SASLauthentication mechanisms itsupports.
Yes
0x21 SASL_AUTH Start SASL authentication. Yes
0x22 SASL_STEP Further authentication steps arerequired.
Yes
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
6.3 IMDG CommandsThis section describes the standard interfaces compatible with DCS IMDG.
l IMDG is compatible with the standard JCache (JSR107) interface. For more information,visit https://www.jcp.org/en/jsr/detail?id=107.
l IMDG is compatible with the standard SQL ANSI-99 interface and supports standardquery, DML, and DDL SQL statements.
NOTE
IMDG is supported only in some regions. The DCS console prevails.
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 23
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 6 Command Compatibility
Issue 01 (2018-10-18) 24
7 Basic Concepts
This section describes basic DCS concepts.
Cache Instance
A cache instance is the minimum resource unit provided by the DCS. You can select thememory specifications and cache type based on actual requirements.
Single-node Instance
Each DCS instance runs on only one cache node. Such DCS instances are mainly used fortemporary data storage but are not suitable for high-reliability service scenarios.
Single-node DCS instances support intensive concurrent read/write operations, but do notimplement data persistence. Data will be deleted after single-node DCS instances are restartedor stopped.
Master/standby Node Instance
DCS instances run in master/standby mode, providing higher availability than single-nodeDCS instances:
1. Each DCS instance runs on two cache nodes (one master and one standby), and supportsdata persistence.
2. The master and standby nodes are kept consistent through data synchronization.3. Only the master cache node provides data read/write service. The standby cache node
replicates data synchronously from the master cache node.4. The standby node takes over automatically if the master node fails.
Cluster Instance
DCS instances run in the cluster mode, providing higher instance specifications andperformance than master/standby DCS instances:
l Features of Redis cluster instances include:– Each DCS instance has at least three master nodes. Compared with master/standby
DCS instances, DCS instances in cluster mode support higher instancespecifications and concurrency.
Distributed Cache ServiceProduct Introduction 7 Basic Concepts
Issue 01 (2018-10-18) 25
– Each master node has a redundant node. If a master node is faulty, the redundantnode becomes the master node and provides data read/write services for users.
– Each redundant node is invisible to clients, and it is kept synchronized with itsmaster node through data synchronization.
l Features of IMDG cluster instances include:– Each DCS instance has at least two nodes to deliver higher reliability.– When the number of replicas is set to 1, data loss does not occur if one node
becomes faulty.– A cluster supports peer-to-peer networks. If any node in the cluster becomes faulty,
externally provided services are not interrupted, but the cluster capacity is affected.
Related Products and DocumentsProduct Document
Distributed Cache Service for RedisDistributed Cache Service forMemcachedElastic Cloud ServerVirtual Private Cloud
Buying a DCS Redis InstanceAccessing a DCS Redis InstanceScaling Up DCS InstancesBacking Up and Restoring DCS InstancesMigrating DCS Data
Distributed Cache ServiceProduct Introduction 7 Basic Concepts
Issue 01 (2018-10-18) 26
8 Change History
Date Description
2018-08-16 Updated Maximum Number of Connections Allowed andMaximum Intranet Bandwidth in the specifications of Redisinstances.
2018-07-23 Added access to DCS2.0 instances through WebCli.
2018-06-20 l Added support for creating a DCS2.0 instance with memorysize greater than 8 GB through a service ticket.
l Opened certain Redis cluster commands. For details aboutcompatibility with DCS commands, see 6.1 RedisCommands.
2018-06-10 l Added support for DCS2.0 instances.l Added support for DCS Memcached instances billed on a
yearly/monthly basis.
2018-05-15 l Added access to DCS instances by using domain names.l Commercially released DCS Memcached instances.
2018-04-18 Added public access to DCS Redis instances.
2018-02-10 Launched the OBT for DCS IMDG instances.
2018-02-02 Commercially released DCS instances of cluster type.
2017-12-15 Launched the OBT for DCS Memcached instances.
2017-11-07 Launched the OBT for DCS instances of cluster type.
2017-08-10 Commercial release (pay-per-use and yearly/monthlysubscription)l Added maintenance time window parameters.l Optimized the available instance memory.
Distributed Cache ServiceProduct Introduction 8 Change History
Issue 01 (2018-10-18) 27
Date Description
2017-07-20 l Added instance scaling and backup and restorationfunctions.
l Added instance running configuration parameters.l Modified the password rules of DCS instances and deleted 1
GB instances.
2017-05-20 l Added batch DCS instance deletion.l Added more configuration options for instance running
parameters.l Optimized the performance to support more concurrent
connections.
2017-01-15 Added support for rich monitoring metrics.
2016-11-10 Added the function of modifying configuration parameters.
2016-09-10 Released the OBT version (single-node and master/standbyDCS instances).
Distributed Cache ServiceProduct Introduction 8 Change History
Issue 01 (2018-10-18) 28