Join us on
Star us on
Get Started
Slack
GitHub
Get Started
v2.5 (latest) v2.2 (stable) v2.1 (earlier version) v2.0 (earlier version) v1.3 (earlier version)
  • GET STARTED
    • Quick start
      • 1. Install YugabyteDB
      • 2. Create a local cluster
      • 3. Explore YSQL
      • 4. Build an application
        • Java
        • NodeJS
        • Go
        • Python
        • Ruby
        • C#
        • PHP
        • C++
        • C
    • Introduction
    • Explore core
      • 1. Linear scalability
      • 2. Fault tolerance
      • 3. Global distribution
      • 4. Auto sharding
      • 5. Tunable reads
      • 6. Observability
  • USER GUIDES
    • Develop
      • Learn app development
        • 1. SQL vs NoSQL
        • 2. Data modeling
        • 3. Data types
        • 4. ACID transactions
        • 5. Aggregations
        • 6. Batch operations
        • 7. Date and time
        • 8. Strings and text
      • Ecosystem integrations
        • Apache Kafka
        • Apache Spark
        • JanusGraph
        • KairosDB
        • Presto
        • Metabase
      • Real-world examples
        • E-Commerce App
        • IoT Fleet Management
        • Retail Analytics
      • Explore sample applications
    • Deploy
      • Checklist
      • Manual deployment
        • 1. System configuration
        • 2. Install software
        • 3. Start YB-Masters
        • 4. Start YB-TServers
        • 5. Verify deployment
      • Kubernetes
        • Helm Chart
        • Helm configuration
        • Local SSD
      • Docker
      • Public clouds
        • Amazon Web Services
        • Google Cloud Platform
        • Microsoft Azure
      • Pivotal Cloud Foundry
      • Yugabyte Platform
        • 1. Prepare cloud environment
        • 2. Install Admin Console
        • 3. Configure Admin Console
        • 4. Configure Cloud Providers
    • Benchmark
      • Performance
      • YCSB
      • Large datasets
    • Secure
      • Security checklist
      • Authentication
      • Authorization
        • 1. RBAC Model
        • 2. Create Roles
        • 3. Grant permissions
      • TLS encryption
        • 1. Prepare nodes
        • 2. Server-server encryption
        • 3. Client-server encryption
        • 4. Connect to cluster
      • Encryption at Rest
    • Manage
      • Backup and restore
        • Backing up data
        • Restoring data
      • Data migration
        • Bulk import
        • Bulk export
      • Change cluster config
      • Upgrade deployment
      • Diagnostics reporting
      • Yugabyte Platform
        • Create universe - Multi-zone
        • Create universe - Multi-region
        • Edit universe
        • Edit config flags
        • Health checking and alerts
        • Create and edit instance tags
        • Node status and actions
        • Read replicas
        • Back up and restore
        • Upgrade universe
        • Delete universe
    • Troubleshoot
      • Troubleshooting overview
      • Cluster level issues
        • YCQL connection issues
        • YEDIS connection Issues
      • Node level issues
        • Check processes
        • Inspect logs
        • System statistics
      • Yugabyte Platform
        • Troubleshoot universes
  • REFERENCE
    • APIs
      • YSQL
        • Statements
          • ABORT
          • ALTER DATABASE
          • ALTER DOMAIN
          • ALTER TABLE
          • BEGIN
          • COMMENT
          • COMMIT
          • COPY
          • CREATE DATABASE
          • CREATE DOMAIN
          • CREATE INDEX
          • CREATE SCHEMA
          • CREATE SEQUENCE
          • CREATE TABLE
          • CREATE TABLE AS
          • CREATE TYPE
          • CREATE USER
          • CREATE VIEW
          • DEALLOCATE
          • DELETE
          • DROP DATABASE
          • DROP DOMAIN
          • DROP SEQUENCE
          • DROP TABLE
          • DROP TYPE
          • END
          • EXECUTE
          • EXPLAIN
          • GRANT
          • INSERT
          • LOCK
          • PREPARE
          • RESET
          • REVOKE
          • ROLLBACK
          • SELECT
          • SET
          • SET CONSTRAINTS
          • SET TRANSACTION
          • SHOW
          • SHOW TRANSACTION
          • TRUNCATE
          • UPDATE
        • Data types
          • Binary
          • Boolean
          • Character
          • Date-time
          • Json
          • Money
          • Numeric
          • Serial
          • UUID
        • Expressions
          • currval()
          • lastval()
          • nextval()
        • Keywords
        • Reserved Names
      • YCQL
        • Quick Start YCQL
        • ALTER KEYSPACE
        • ALTER ROLE
        • ALTER TABLE
        • CREATE INDEX
        • CREATE KEYSPACE
        • CREATE ROLE
        • CREATE TABLE
        • CREATE TYPE
        • DROP INDEX
        • DROP KEYSPACE
        • DROP ROLE
        • DROP TABLE
        • DROP TYPE
        • GRANT PERMISSION
        • GRANT ROLE
        • REVOKE PERMISSION
        • REVOKE ROLE
        • USE
        • INSERT
        • SELECT
        • UPDATE
        • DELETE
        • TRANSACTION
        • TRUNCATE
        • Simple Value
        • Subscript
        • Function Call
        • Operator Call
        • BLOB
        • BOOLEAN
        • MAP, SET, LIST
        • FROZEN
        • INET
        • Integer & Counter
        • Non-Integer
        • TEXT
        • Date & Time Types
        • UUID & TIMEUUID
        • JSONB
        • Date and time functions
    • CLIs
      • yb-ctl
      • yb-docker-ctl
      • yb-master
      • yb-tserver
      • ysqlsh
      • cqlsh
    • Sample data
      • Chinook
      • Northwind
      • PgExercises
      • SportsDB
    • Tools
      • TablePlus
  • RELEASES
    • Release history
      • v1.3.1
      • v1.3.0
      • v1.2.12
      • v1.2.11
      • v1.2.10
      • v1.2.9
      • v1.2.8
      • v1.2.6
      • v1.2.5
      • v1.2.4
  • CONCEPTS
    • Architecture
      • Design goals
      • Layered architecture
      • Basic concepts
        • Universe
        • YB-TServer
        • YB-Master
        • Acknowledgements
      • Query layer
        • Overview
      • DocDB store
        • Sharding
        • Replication
        • Persistence
        • Performance
      • DocDB transactions
        • Isolation Levels
        • Single row transactions
        • Distributed transactions
        • Transactional IO path
  • FAQ
    • Comparisons
      • CockroachDB
      • Google Cloud Spanner
      • MongoDB
      • FoundationDB
      • Amazon DynamoDB
      • Azure Cosmos DB
      • Apache Cassandra
      • Redis in-memory store
      • Apache HBase
    • Other FAQs
      • Product
      • Architecture
      • Yugabyte Platform
      • API compatibility
  • CONTRIBUTOR GUIDES
    • Get involved
  • Misc
    • YEDIS
      • Quick start
      • Develop
        • Client drivers
          • C
          • C++
          • C#
          • Go
          • Java
          • NodeJS
          • Python
      • API reference
        • APPEND
        • AUTH
        • CONFIG
        • CREATEDB
        • DELETEDB
        • LISTDB
        • SELECT
        • DEL
        • ECHO
        • EXISTS
        • EXPIRE
        • EXPIREAT
        • FLUSHALL
        • FLUSHDB
        • GET
        • GETRANGE
        • GETSET
        • HDEL
        • HEXISTS
        • HGET
        • HGETALL
        • HINCRBY
        • HKEYS
        • HLEN
        • HMGET
        • HMSET
        • HSET
        • HSTRLEN
        • HVALS
        • INCR
        • INCRBY
        • KEYS
        • MONITOR
        • PEXPIRE
        • PEXPIREAT
        • PTTL
        • ROLE
        • SADD
        • SCARD
        • RENAME
        • SET
        • SETEX
        • PSETEX
        • SETRANGE
        • SISMEMBER
        • SMEMBERS
        • SREM
        • STRLEN
        • ZRANGE
        • TSADD
        • TSCARD
        • TSGET
        • TSLASTN
        • TSRANGEBYTIME
        • TSREM
        • TSREVRANGEBYTIME
        • TTL
        • ZADD
        • ZCARD
        • ZRANGEBYSCORE
        • ZREM
        • ZREVRANGE
        • ZSCORE
        • PUBSUB
        • PUBLISH
        • SUBSCRIBE
        • UNSUBSCRIBE
        • PSUBSCRIBE
        • PUNSUBSCRIBE
YEDIS API reference
> YEDIS >

YEDIS API reference

Attention

This page documents an earlier version. Go to the latest (v2.3) version.

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 type Development status
String Supported
Hash Supported
Set Supported
Sorted set Supported
List Not yet supported
Bitmaps Not yet supported
HyperLogLogs Not yet supported
GeoSpatial Not yet supported
Time series New data type in YugabyteDB

Commands

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

Command Description
String data type
APPEND Append data to end of string
DEL Delete keys from a database
EXISTS Check if the keys are present
EXPIRE Set key timeout in seconds
EXPIREAT Set key timeout as timestamp
SET Write or overwrite a string value
SETEX Write or overwrite a string value and set TTL in seconds
PSETEX Write or overwrite a string value and set TTL in milliseconds
SETRANGE Write a subsection of a string
GET Read string value
GETRANGE Read substring
GETSET Atomically read and write a string
INCR Increment the value by one
KEYS Retrieve all keys matching a pattern
PEXPIRE Set key timeout in milliseconds
PEXPIREAT Set key timeout as timestamp in milliseconds
PTTL Get time to live for key in milliseconds
TTL Get time to live for key in seconds
Hash data type
HDEL Remove specified entries from a hash
HEXISTS Check if the subkeys are present in the hash
HGET Read a field in hash
HGETALL Read all the contents in a hash
HKEYS Read all value-keys in a hash
HLEN Get the number of entries in a hash
HMGET Read values for the given keys in a hash
HMSET Write values for the given keys in a hash
HSET Write one entry in a hash
HSTRLEN Read the length of a specified entry in a hash
HVALS Read all values in a hash
Set data type
SADD Add entries to a set
SCARD Read the number of entries in a set
SISMEMBER Check if the members are present in a set
SMEMBERS Read all members of a set
SREM Remove members from a set
STRLEN Read the length of a string
Time series data type
TSADD Add a time series entry
TSCARD Retrieve the number of elements in the given time series
TSGET Retrieve a time series entry
TSLASTN Retrieve the latest N time series entries for a given time series
TSRANGEBYTIME Retrieve time series entries for a given time range
TSREM Delete a time series entry
TSREVRANGEBYTIME Retrieve time series entries for a given time range ordered from newest to oldest
Sorted set data type
ZADD Add a sorted set entry
ZCARD Get cardinality of a sorted set
ZRANGE Retrieve sorted set entries for given index range
ZRANGEBYSCORE Retrieve sorted set entries for a given score range
ZREM Delete a sorted set entry
ZREVRANGE Retrieve sorted set entries for given index range ordered from highest to lowest score
ZSCORE Get the score of member at a sorted set key
General
AUTH Authenticates a client connection to YEDIS API
CONFIG Not fully supported. Only used to set the required password(s) for YEDIS API
ECHO Output messages
MONITOR Debugging tool to see all requests that are processed by a YEDIS API server
ROLE Read role of a node
RENAME Rename one key as another
Database
FLUSHALL Delete all keys from all databases
FLUSHDB Delete all keys from a database
CREATEDB Create a new yedis database
LISTDB List all the yedis databases present
DELETEDB Delete a yedis database
SELECT Select the target database to communcate with
Pub-Sub
PUBSUB Used to query the state of the Pub/Sub system.
PUBLISH Publishes a message to the specified channel
SUBSCRIBE Subscribes the client to the specified channel(s)
PSUBSCRIBE Subscribes the client to the specified pattern(s)
UNSUBSCRIBE Unubscribes the client from the specified channel(s)
PUNSUBSCRIBE Unubscribes the client from the specified pattern(s)
Ask our community
  • Slack
  • Github
  • Forum
  • StackOverflow
Yugabyte
Contact us

Copyright © 2017-2020 Yugabyte, Inc. All rights reserved.