Back to Yugabyte Db

YEDIS API reference

docs/content/stable/yedis/api/_index.md

2026.1.0.0-b295.1 KB
Original Source

Introduction

The YEDIS API provides a clustered, auto-sharded, globally distributed and persistent key-value API that is compatible with the Redis commands library. A Redis client can connect, send requests, and receive results from YugabyteDB.

Data types

The following data types can be read and written via the YEDIS API.

Data typeDevelopment status
StringSupported
HashSupported
SetSupported
Sorted setSupported
ListNot yet supported
BitmapsNot yet supported
HyperLogLogsNot yet supported
GeoSpatialNot yet supported
Time seriesNew data type in YugabyteDB

Commands

Redis-cli or any Redis applications can access YugabyteDB using the YEDIS API. The following Redis commands are accepted.

CommandDescription
<b>String data type </b>
APPENDAppend data to end of string
DELDelete keys from a database
EXISTSCheck if the keys are present
EXPIRESet key timeout in seconds
EXPIREATSet key timeout as timestamp
SETWrite or overwrite a string value
SETEXWrite or overwrite a string value and set TTL in seconds
PSETEXWrite or overwrite a string value and set TTL in milliseconds
SETRANGEWrite a subsection of a string
GETRead string value
GETRANGERead substring
GETSETAtomically read and write a string
INCRIncrement the value by one
KEYSRetrieve all keys matching a pattern
PEXPIRESet key timeout in milliseconds
PEXPIREATSet key timeout as timestamp in milliseconds
PTTLGet time to live for key in milliseconds
TTLGet time to live for key in seconds
<b> Hash data type </b>
HDELRemove specified entries from a hash
HEXISTSCheck if the subkeys are present in the hash
HGETRead a field in hash
HGETALLRead all the contents in a hash
HKEYSRead all value-keys in a hash
HLENGet the number of entries in a hash
HMGETRead values for the given keys in a hash
HMSETWrite values for the given keys in a hash
HSETWrite one entry in a hash
HSTRLENRead the length of a specified entry in a hash
HVALSRead all values in a hash
<b> Set data type </b>
SADDAdd entries to a set
SCARDRead the number of entries in a set
SISMEMBERCheck if the members are present in a set
SMEMBERSRead all members of a set
SREMRemove members from a set
STRLENRead the length of a string
<b> Time series data type </b>
TSADDAdd a time series entry
TSCARDRetrieve the number of elements in the given time series
TSGETRetrieve a time series entry
TSLASTNRetrieve the latest N time series entries for a given time series
TSRANGEBYTIMERetrieve time series entries for a given time range
TSREMDelete a time series entry
TSREVRANGEBYTIMERetrieve time series entries for a given time range ordered from newest to oldest
<b> Sorted set data type </b>
ZADDAdd a sorted set entry
ZCARDGet cardinality of a sorted set
ZRANGERetrieve sorted set entries for given index range
ZRANGEBYSCORERetrieve sorted set entries for a given score range
ZREMDelete a sorted set entry
ZREVRANGERetrieve sorted set entries for given index range ordered from highest to lowest score
ZSCOREGet the score of member at a sorted set key
<b> General </b>
AUTHAuthenticates a client connection to YEDIS API
CONFIGNot fully supported. Only used to set the required password(s) for YEDIS API
ECHOOutput messages
MONITORDebugging tool to see all requests that are processed by a YEDIS API server
ROLERead role of a node
RENAMERename one key as another
<b> Database </b>
FLUSHALLDelete all keys from all databases
FLUSHDBDelete all keys from a database
CREATEDBCreate a new yedis database
LISTDBList all the yedis databases present
DELETEDBDelete a yedis database
SELECTSelect the target database to communcate with
<b> Pub-Sub </b>
PUBSUBUsed to query the state of the Pub/Sub system.
PUBLISHPublishes a message to the specified channel
SUBSCRIBESubscribes the client to the specified channel(s)
PSUBSCRIBESubscribes the client to the specified pattern(s)
UNSUBSCRIBEUnubscribes the client from the specified channel(s)
PUNSUBSCRIBEUnubscribes the client from the specified pattern(s)