Design a site like this with
Get started

Redis Overview

Redis is a project by Redis Labs whose sole purpose is to implement an in-memory database that supports various data structures. Originally developed by Salvatore Sanfilippo in 2009, its current version is 6.0.9 as of September 11, 2020.

Redis is open-source and is under BSD license. Mainly its of key-value nature and written in ANSI C.

Useful Redis Commands

  1. Setting a value:
    SET chapter 67
  2. Retrieving a value:
    GET chapter
  3. Setting multiple key-values:
    MSET start “Fatiha” complete “Naas”
  4. Incrementing a value:
    INCR chapter
    (integer) 68
  5. Decrementing a value:
    DECR chapter
    (integer) 67
  6. If a value exists:
    EXISTS chapter
    (integer) 1
  7. When a value exists not:
    EXISTS name
    (integer) 0
  8. Removing a value:
    DEL chapter
    (integer) 1
  9. Removing all keys:
  10. Setting a server name:
    SET server:name Zend
  11. Getting a server name:
    GET server:name
  12. Setting a server port:
    SET server:port 8083
  13. Getting a server port:
    GET server:port
  14. Renaming a key:
    RENAME chapter sura
  15. Authenticating a user:
    AUTH MyUserName PasswordIs123
  16. Assigning a name to current connection:
  17. Retrieving the current client’s name:
  18. Printing any value:
    ECHO “Quran.”
  19. Closing server connection:
  20. Setting a hash value:
    HSET myhash f1 5
  21. Getting the hash value:
    HGET myhash f1
  22. Getting number of hash fields:
    HLEN myhash
  23. Adding key-value to a list:
    LPUSH ThisList 1 2 3
    (integer) 3
  24. Sorting a list:
    SORT ThisList
    1 2 3
    (Sorts in ascending order, to reverse the sorting – add DESC to the command)
  25. Removing the last value from list:
    LPOP ThisList
  26. Adding members to aset:
    SADD Set 3 2 1
    (integer) 3
  27. Checking members of a set:
  28. Joining two sets:
    SUNION Set1 Set2
  29. Difference between two sets:
    SDIFF Set1 Set2

There are more commands available to work with a Redis database if you need. You may find them on .


Published by Farial Mahmod Tishan

Life-long learner. Developing Flutter apps on Parrot Linux OS .

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: