Redis: SET/GET Key:Value – Redis-CLI

Redis is a key-value database (also known as a key-value store) that uses a simple key/value method to store data.

Strings are the simplest data type in Redis and are simple key/value entries.

To save or fetch string data there are Redis SET and GET commands.

Redis SET command creates a key and assigns it some value (if the key already exists it just updates the value).

Redis GET command returns a value assigned to a key. (more…)

Redis: Get All Keys – Redis-CLI

There are two ways to get all keys from the all databases in Redis.

The first way is to list keys using --scan option and the second one is to get all keys using the KEYS command.

Note that the first way of getting all keys is preferable as it doesn’t require the client to load all the keys into memory despite of the KEYS command.

Use KEYS command only when the key space is reasonably sized. (more…)