SlideShare a Scribd company logo
Redis cache
Redis is a in-memory, key-value data store. it’s
the most popular key-value data store, used by all
big IT brands in this world. Amazon Elastic Cache
supports Redis which makes redis a very powerful
and must know key-value data store.
What Is In-Memory, Key-
Value Store
Key-Value store is a storage system where data is
stored in form of key and value pairs. When we
say in-memory key-value store, by that we mean
that the key-value pairs are stored in primary
memory(RAM). So we can say that Redis stored
data in RAM in form of key-value pairs.
In Redis, key has to be a string but value can be a
string, list, set, sorted set or hash.
What Is In-Memory, Key-
Value Store
Lists: collections of string elements sorted
according to the order of insertion. They are
basically linked lists.
Sets: collections of unique, unsorted string
elements.
What Is In-Memory, Key-
Value Store
Sorted sets, similar to Sets but where every string
element is associated to a floating number value,
called score. The elements are always taken
sorted by their score, so unlike Sets it is possible
to retrieve a range of elements (for example you
may ask: give me the top 10, or the bottom 10).
Hashes, which are maps composed of fields
associated with values. Both the field and the
value are strings. This is very similar to Ruby or
Python hashes
Advantage And Disadvantage
of Redis over DBMS
Database Management systems store everything
in second storage which makes read and write
operations very slow. But Redis stores everything
in primary memory which is very fast in read and
write of data.
Advantage And Disadvantage
of Redis over DBMS
Exceptionally fast − Redis is very fast and can
perform about 110000 SETs per second, about
81000 GETs per second.
Supports rich data types − Redis natively supports
most of the datatypes that developers already
know such as list, set, sorted set, and hashes.
This makes it easy to solve a variety of problems
as we know which problem can be handled better
by which data type.
Advantage And Disadvantage
of Redis over DBMS
Operations are atomic − All Redis operations are
atomic, which ensures that if two clients
concurrently access, Redis server will receive the
updated value.
Multi-utility tool − Redis is a multi-utility tool and
can be used in a number of use cases such as
caching, messaging-queues (Redis natively
supports Publish/Subscribe), any short-lived data
in your application, such as web application
sessions, web page hit counts, etc.
Advantage And Disadvantage
of Redis over DBMS
Primary memory is limited(much lesser size and
expensive than secondary) therefore Redis
cannot store large files or binary data. It can only
store those small textual information which needs
to be accessed, modified and inserted at a very
fast rate.
Redis Single Instance
Architecture
Redis architecture contains two main processes:
Redis client and Redis Server.
Redis Single Instance
Architecture
Redis client and server can be in the same
computer or in two different computers.
Redis server is responsible for storing data in
memory. It handles all kinds of management and
forms the major part of architecture. Redis client
can be Redis console client or any other
programming language’s Redis API.
Redis Single Instance
Architecture
As we saw that Redis stores everything in primary
memory. Primary memory is volatile and therefore
we will loose all stored data once we restart our
Redis server or computer. Therefore we need a
way for datastore persistance.
Redis Persistance
There are two different ways to make Redis
persistance: RDB and AOF .
Redis Persistance
RDB Mechanism
RDB makes a copy of all the data in memory and
stores them in secondary storage(permanent
storage). This happens in a specified interval. So
there is chance that you will loose data that are
set after RDB’s last snapshot.
Redis Persistance
AOF
AOF logs all the write operations received by the
server. Therefore everything is persistance. The
problem with using AOF is that it writes to disk for
every operation and it is a expensive task and
also size of AOF file is large than RDB file.
Redis Persistance
You can use AOF and RDB together to get best
persistance result.
Backup And Recovery Of
Redis DataStore
Redis does not provide any mechanism for
datastore backup and recovery. Therefore if there
is any hard disk crash or any other kind of
disaster then all data will be lost. You need to use
some third party server backup and recovery
softwares to workaround it.
If you are using Redis in a replicated environment
then there is no need for backup.
Redis commands (SET)
SET supports a set of options that modify its
behavior:
1- EX seconds -- Set the specified expire time, in seconds
Ex ( SETEX mykey 10 "Hello").
2- PX milliseconds -- Set the specified expire time, in milliseconds.
3- NX -- Only set the key if it does not already exist.
Redis commands (GET)
Get the value of key. If the key does not exist the
special value nil is returned. An error is returned if
the value stored at key is not a string, because
GET only handles string values.
Redis commands (DEL)
Removes the specified keys. A key is ignored if it
does not exist.
Sets commands
1- SADD : Add the specified members to the set
stored at key
2- SMEMBERS : Returns all the members of the
set value stored at key.
3- SCARD : Returns the set cardinality (number of
elements) of the set stored at key.
4- SDIFF : Returns the members of the set
resulting from the difference between the first set
and all the successive sets.
Hash commands
HSET : Sets field in the hash stored at key to
value. If key does not exist, a new key holding a
hash is created. If field already exists in the hash,
it is overwritten.
ex : HSET myhash field1 "Hello"
HDEL : Removes the specified fields from the
hash stored at key.
ex : HDEL myhash field1
Hash commands
HGET : Returns the value associated with field in
the hash stored at key.
Ex : HGET myhash field1
HGETALL : Returns all fields and values of the
hash stored at key. In the returned value, every
field name is followed by its value, so the length of
the reply is twice the size of the hash.
Ex :HGETALL myhash
Who's using Redis?
Twitter GitHub Weibo Pinterest Snapchat
Craigslist Digg StackOverflow Flickr
Good bay
Created by : Ahmad EL-Khuja
Akhuja@bayt.net

More Related Content

What's hot (20)

PDF
HBase Advanced - Lars George
JAX London
 
PPTX
Caching solutions with Redis
George Platon
 
PPT
Introduction to redis
Tanu Siwag
 
PDF
An Introduction to Redis for Developers.pdf
Stephen Lorello
 
PPTX
Redis introduction
Federico Daniel Colombo Gennarelli
 
PPTX
redis basics
Manoj Kumar
 
PDF
Redis cluster
iammutex
 
PDF
MongoDB WiredTiger Internals
Norberto Leite
 
KEY
Redis in Practice
Noah Davis
 
ODP
An Introduction to REDIS NoSQL database
Ali MasudianPour
 
PDF
Building robust CDC pipeline with Apache Hudi and Debezium
Tathastu.ai
 
PDF
Everything you always wanted to know about Redis but were afraid to ask
Carlos Abalde
 
PDF
Redis persistence in practice
Eugene Fidelin
 
PPTX
Ceph Introduction 2017
Karan Singh
 
PDF
HandsOn ProxySQL Tutorial - PLSC18
Derek Downey
 
PDF
MySQL Parallel Replication: inventory, use-case and limitations
Jean-François Gagné
 
PDF
Zabbix Monitoring Platform
Seyedmajid Etehadi
 
PDF
AWS tutorial-Part54:AWS Route53
SaM theCloudGuy
 
PPTX
MySQL8.0_performance_schema.pptx
NeoClova
 
KEY
Introduction to memcached
Jurriaan Persyn
 
HBase Advanced - Lars George
JAX London
 
Caching solutions with Redis
George Platon
 
Introduction to redis
Tanu Siwag
 
An Introduction to Redis for Developers.pdf
Stephen Lorello
 
redis basics
Manoj Kumar
 
Redis cluster
iammutex
 
MongoDB WiredTiger Internals
Norberto Leite
 
Redis in Practice
Noah Davis
 
An Introduction to REDIS NoSQL database
Ali MasudianPour
 
Building robust CDC pipeline with Apache Hudi and Debezium
Tathastu.ai
 
Everything you always wanted to know about Redis but were afraid to ask
Carlos Abalde
 
Redis persistence in practice
Eugene Fidelin
 
Ceph Introduction 2017
Karan Singh
 
HandsOn ProxySQL Tutorial - PLSC18
Derek Downey
 
MySQL Parallel Replication: inventory, use-case and limitations
Jean-François Gagné
 
Zabbix Monitoring Platform
Seyedmajid Etehadi
 
AWS tutorial-Part54:AWS Route53
SaM theCloudGuy
 
MySQL8.0_performance_schema.pptx
NeoClova
 
Introduction to memcached
Jurriaan Persyn
 

Viewers also liked (20)

PDF
An Updated Performance Comparison of Virtual Machines and Linux Containers
Kento Aoyama
 
PPTX
Sensu Monitoring
Mohanasundaram Ponnusamy
 
PPTX
O uso do computador na educação
Rafael Nogueira
 
PPTX
Introducción a la P.O.O.
Fernando Santillan
 
PPSX
Університетське містечко ЗНУ: подорож крізь десятиліття
Олена Семенець
 
PDF
ERADA M3 S1 - Business Model Design
Center for Entrepreneurship
 
PDF
Demystifying datastores
vishnu rao
 
PDF
Introduction to concurrent programming with akka actors
datamantra
 
PPTX
Seo
wajdi jurry
 
PPTX
Golang 101 (Concurrency vs Parallelism)
Pramesti Hatta K.
 
PPTX
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
Javier Caballero
 
PDF
Security Monitoring with eBPF
Alex Maestretti
 
PDF
Introduction of Mesosphere DCOS
Deughyeon Chang
 
PPTX
Valeria Ramos
Valejrd
 
PPTX
Сергей Радзыняк ".NET Microservices in Real Life"
Fwdays
 
PDF
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
Corley S.r.l.
 
PDF
Introduction To Anypoint CloudHub With Mulesoft
Jitendra Bafna
 
PPTX
Redis原生命令介绍
简放 视野
 
PDF
A evolução do açúcar.
Jean Paulo Mendes Alves
 
DOC
Инновационный опыт работы центра медико-психолого-социального сопровождения с...
Parusnik55
 
An Updated Performance Comparison of Virtual Machines and Linux Containers
Kento Aoyama
 
Sensu Monitoring
Mohanasundaram Ponnusamy
 
O uso do computador na educação
Rafael Nogueira
 
Introducción a la P.O.O.
Fernando Santillan
 
Університетське містечко ЗНУ: подорож крізь десятиліття
Олена Семенець
 
ERADA M3 S1 - Business Model Design
Center for Entrepreneurship
 
Demystifying datastores
vishnu rao
 
Introduction to concurrent programming with akka actors
datamantra
 
Golang 101 (Concurrency vs Parallelism)
Pramesti Hatta K.
 
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
Javier Caballero
 
Security Monitoring with eBPF
Alex Maestretti
 
Introduction of Mesosphere DCOS
Deughyeon Chang
 
Valeria Ramos
Valejrd
 
Сергей Радзыняк ".NET Microservices in Real Life"
Fwdays
 
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
Corley S.r.l.
 
Introduction To Anypoint CloudHub With Mulesoft
Jitendra Bafna
 
Redis原生命令介绍
简放 视野
 
A evolução do açúcar.
Jean Paulo Mendes Alves
 
Инновационный опыт работы центра медико-психолого-социального сопровождения с...
Parusnik55
 
Ad

Similar to Redis overview (20)

PPTX
redis-demo.pptx
SNEHKUMAR30
 
PPTX
Redis database
Ñáwrás Ñzár
 
PDF
Introduction to Redis
Itamar Haber
 
PDF
Redis overview
Ashokkumar T A
 
ODP
Beyond relational database - Building high performance websites using Redis a...
Dinh Pham
 
DOCX
Redis vs Memcached
Gaurav Agrawal
 
PDF
#SydPHP - The Magic of Redis
Aaron Weatherall
 
PPTX
Introduction to Redis
Arnab Mitra
 
PDF
Fun with Ruby and Redis
javier ramirez
 
PPTX
Redis meetup
Nikhil Dole
 
PDF
Introduction to hadoop ecosystem
Rupak Roy
 
PPTX
Redis data structure and Performance Optimization
Knoldus Inc.
 
PPT
Nextag talk
Joydeep Sen Sarma
 
PPTX
2_Redis.pptx very useful for begginers yes
soufianbouktaib1
 
PPTX
Big Data and Hadoop
Mr. Ankit
 
PDF
mar07-redis.pdf
AnisSalhi3
 
PPTX
Hadoop File system (HDFS)
Prashant Gupta
 
PPTX
Big Data Analytics -Introduction education
mohammedansaralima
 
ZIP
Redis and Ohm
awksedgreep
 
DOCX
Various raid levels pros & cons
IT Tech
 
redis-demo.pptx
SNEHKUMAR30
 
Redis database
Ñáwrás Ñzár
 
Introduction to Redis
Itamar Haber
 
Redis overview
Ashokkumar T A
 
Beyond relational database - Building high performance websites using Redis a...
Dinh Pham
 
Redis vs Memcached
Gaurav Agrawal
 
#SydPHP - The Magic of Redis
Aaron Weatherall
 
Introduction to Redis
Arnab Mitra
 
Fun with Ruby and Redis
javier ramirez
 
Redis meetup
Nikhil Dole
 
Introduction to hadoop ecosystem
Rupak Roy
 
Redis data structure and Performance Optimization
Knoldus Inc.
 
Nextag talk
Joydeep Sen Sarma
 
2_Redis.pptx very useful for begginers yes
soufianbouktaib1
 
Big Data and Hadoop
Mr. Ankit
 
mar07-redis.pdf
AnisSalhi3
 
Hadoop File system (HDFS)
Prashant Gupta
 
Big Data Analytics -Introduction education
mohammedansaralima
 
Redis and Ohm
awksedgreep
 
Various raid levels pros & cons
IT Tech
 
Ad

Recently uploaded (20)

PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
The Future of Artificial Intelligence (AI)
Mukul
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 

Redis overview

  • 1. Redis cache Redis is a in-memory, key-value data store. it’s the most popular key-value data store, used by all big IT brands in this world. Amazon Elastic Cache supports Redis which makes redis a very powerful and must know key-value data store.
  • 2. What Is In-Memory, Key- Value Store Key-Value store is a storage system where data is stored in form of key and value pairs. When we say in-memory key-value store, by that we mean that the key-value pairs are stored in primary memory(RAM). So we can say that Redis stored data in RAM in form of key-value pairs. In Redis, key has to be a string but value can be a string, list, set, sorted set or hash.
  • 3. What Is In-Memory, Key- Value Store Lists: collections of string elements sorted according to the order of insertion. They are basically linked lists. Sets: collections of unique, unsorted string elements.
  • 4. What Is In-Memory, Key- Value Store Sorted sets, similar to Sets but where every string element is associated to a floating number value, called score. The elements are always taken sorted by their score, so unlike Sets it is possible to retrieve a range of elements (for example you may ask: give me the top 10, or the bottom 10). Hashes, which are maps composed of fields associated with values. Both the field and the value are strings. This is very similar to Ruby or Python hashes
  • 5. Advantage And Disadvantage of Redis over DBMS Database Management systems store everything in second storage which makes read and write operations very slow. But Redis stores everything in primary memory which is very fast in read and write of data.
  • 6. Advantage And Disadvantage of Redis over DBMS Exceptionally fast − Redis is very fast and can perform about 110000 SETs per second, about 81000 GETs per second. Supports rich data types − Redis natively supports most of the datatypes that developers already know such as list, set, sorted set, and hashes. This makes it easy to solve a variety of problems as we know which problem can be handled better by which data type.
  • 7. Advantage And Disadvantage of Redis over DBMS Operations are atomic − All Redis operations are atomic, which ensures that if two clients concurrently access, Redis server will receive the updated value. Multi-utility tool − Redis is a multi-utility tool and can be used in a number of use cases such as caching, messaging-queues (Redis natively supports Publish/Subscribe), any short-lived data in your application, such as web application sessions, web page hit counts, etc.
  • 8. Advantage And Disadvantage of Redis over DBMS Primary memory is limited(much lesser size and expensive than secondary) therefore Redis cannot store large files or binary data. It can only store those small textual information which needs to be accessed, modified and inserted at a very fast rate.
  • 9. Redis Single Instance Architecture Redis architecture contains two main processes: Redis client and Redis Server.
  • 10. Redis Single Instance Architecture Redis client and server can be in the same computer or in two different computers. Redis server is responsible for storing data in memory. It handles all kinds of management and forms the major part of architecture. Redis client can be Redis console client or any other programming language’s Redis API.
  • 11. Redis Single Instance Architecture As we saw that Redis stores everything in primary memory. Primary memory is volatile and therefore we will loose all stored data once we restart our Redis server or computer. Therefore we need a way for datastore persistance.
  • 12. Redis Persistance There are two different ways to make Redis persistance: RDB and AOF .
  • 13. Redis Persistance RDB Mechanism RDB makes a copy of all the data in memory and stores them in secondary storage(permanent storage). This happens in a specified interval. So there is chance that you will loose data that are set after RDB’s last snapshot.
  • 14. Redis Persistance AOF AOF logs all the write operations received by the server. Therefore everything is persistance. The problem with using AOF is that it writes to disk for every operation and it is a expensive task and also size of AOF file is large than RDB file.
  • 15. Redis Persistance You can use AOF and RDB together to get best persistance result.
  • 16. Backup And Recovery Of Redis DataStore Redis does not provide any mechanism for datastore backup and recovery. Therefore if there is any hard disk crash or any other kind of disaster then all data will be lost. You need to use some third party server backup and recovery softwares to workaround it. If you are using Redis in a replicated environment then there is no need for backup.
  • 17. Redis commands (SET) SET supports a set of options that modify its behavior: 1- EX seconds -- Set the specified expire time, in seconds Ex ( SETEX mykey 10 "Hello"). 2- PX milliseconds -- Set the specified expire time, in milliseconds. 3- NX -- Only set the key if it does not already exist.
  • 18. Redis commands (GET) Get the value of key. If the key does not exist the special value nil is returned. An error is returned if the value stored at key is not a string, because GET only handles string values.
  • 19. Redis commands (DEL) Removes the specified keys. A key is ignored if it does not exist.
  • 20. Sets commands 1- SADD : Add the specified members to the set stored at key 2- SMEMBERS : Returns all the members of the set value stored at key. 3- SCARD : Returns the set cardinality (number of elements) of the set stored at key. 4- SDIFF : Returns the members of the set resulting from the difference between the first set and all the successive sets.
  • 21. Hash commands HSET : Sets field in the hash stored at key to value. If key does not exist, a new key holding a hash is created. If field already exists in the hash, it is overwritten. ex : HSET myhash field1 "Hello" HDEL : Removes the specified fields from the hash stored at key. ex : HDEL myhash field1
  • 22. Hash commands HGET : Returns the value associated with field in the hash stored at key. Ex : HGET myhash field1 HGETALL : Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash. Ex :HGETALL myhash
  • 23. Who's using Redis? Twitter GitHub Weibo Pinterest Snapchat Craigslist Digg StackOverflow Flickr