Hello friends! In this post, I will be discussing about data types in redis. Friends, there are 5 data types in redis:

1. String
2. Hash
3. List
4. Set
5. Sorted Set

 We will discuss each of them one by one with their commands.

1. String: It is the most basic Redis data type. It is basically a sequence of bytes. One of the important points about Redis string is that it is binary safe. What does it mean by binary safe? Binary safe means unlike Java or C++, the length of Redis string is not determined by any special terminating characters. By default, a single Redis String can be of maximum 512 MB.

2. Hash: A Redis hash is an unordered collection of key-value pair. In this, a hash key is associated with other Redis string value. The value containes other key-value pairs. We can not use other complex data structures, such as Sets, Lists or other Hashes as values. Redis hashes are used to represent objects.

3. List: A Redis List is a liked list of string values. It can store at max 2^32 - 1 elements. We can add elements to the head or tail of Redis List. The Redis List has mainly two uses:
a. It is used to implement stack and queues.
b. It can be used to build queue management for background worker system.

4. Set: A Redis Set is an unordered collection of strings. It can store at max 2^32 - 1 elements.

5. Sorted Set: Redis sorted sets are non-repeating collections of string.It is similar to Redis set. The difference is every member of Redis set is associated with a score which is used for sorting from the lower to higher score.In sorted sets, score may repeat.