Prepared by 201 Qadir!
Remote Dictionary Server
9 May, 2025
1
What is Redis?
Redis (Remote Dictionary Server) is an open-source, in-memory data
structure store. It is often used as:
• A database
• A cache
• A message broker
Key features of Redis include:
• In-memory storage : Data is stored in RAM for fast access.
• Persistence : Data can be saved to disk for durability.
• Data structures : Supports strings, hashes, lists, sets, sorted sets, bitmaps, hyper loglogs, and more.
• High performance : Extremely fast due to its in-memory nature.
• Atomic operations : Ensures thread safety with single-threaded architecture.
2
Data Types
• Strings • Hashes • Lists
Redis string is a sequence of A Redis hash is a collection of Redis Lists are simply lists of
bytes. Strings in Redis are key value pairs. Redis Hashes strings, sorted by insertion
binary safe, meaning they have are maps between string fields order. You can add elements to
a known length not determined and string values. Hence, they a Redis List on the head or on
by any special terminating are used to represent objects. the tail.
characters. Thus, you can store
anything up to 512 megabytes
in one string.
3
Data Types
• Sets
Redis Sets are an unordered collection of
strings. In Redis, you can add, remove, and
test for the existence of members in O(1)
time complexity.
• Sorted Sets
Redis Sorted Sets are similar to Redis
Sets, non-repeating collections of Strings.
The difference is, every member of a
Sorted Set is associated with a score, that
is used in order to take the sorted set
ordered, from the smallest to the greatest
score. While members are unique, the
scores may be repeated.
4
Use Cases
• Caching • Message Queues / Pub-Sub
Reduce database load and speed up data retrieval.
Decouple parts of a system using Redis as a message broker.
• Session Storage • Leaderboard / Ranking System
Store user login sessions in a web application. Maintain a sorted list of scores or points.
5
Performance Benefits
Redis excels in performance due to its in-memory architecture, which enables
quick access to data. This results in significantly lower latency compared to
traditional databases. With high throughput capabilities, Redis efficiently manages
large volumes of requests, making it ideal for real-time applications where speed
and responsiveness are critical.
6
Replication and Persistence
Persistence in Redis
Redis supports two persistence mechanisms:
RDB (Redis Database File) : Periodic snapshots of the dataset.
AOF (Append-Only File) : Logs every write operation to ensure
durability.
You can configure persistence in the redis.conf file. For example:
7
Conclusion
• Summary of Key Points
Redis shines as an in-memory data solution, adept in diverse
use cases like caching and analytics. Its speed is unmatched,
making it a top choice for applications demanding real-time
data access. By supporting a variety of data types, Redis
offers flexibility that improves application performance. Its
robust ecosystem and community further bolster its effective
integration into systems.
8
Thank you
Created by Ali Azizkhani
Presentor Matin Parian
Content production
Arya Naderi , Hossein Fazel