SlideShare a Scribd company logo
1 of 24
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

A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redisZhichao Liang
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAli MasudianPour
 
An Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfAn Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfStephen Lorello
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with RedisGeorge Platon
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practiceEugene Fidelin
 
Redis cluster
Redis clusterRedis cluster
Redis clusteriammutex
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redisDaeMyung Kang
 
RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedis Labs
 
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTOClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTOAltinity Ltd
 
Redis Reliability, Performance & Innovation
Redis Reliability, Performance & InnovationRedis Reliability, Performance & Innovation
Redis Reliability, Performance & InnovationRedis Labs
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxIDERA Software
 
Introduction to Database Services
Introduction to Database ServicesIntroduction to Database Services
Introduction to Database ServicesAmazon Web Services
 
Redis - Usability and Use Cases
Redis - Usability and Use CasesRedis - Usability and Use Cases
Redis - Usability and Use CasesFabrizio Farinacci
 
Mongo DB 완벽가이드 - 4장 쿼리하기
Mongo DB 완벽가이드 - 4장 쿼리하기Mongo DB 완벽가이드 - 4장 쿼리하기
Mongo DB 완벽가이드 - 4장 쿼리하기JangHyuk You
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumTathastu.ai
 

What's hot (20)

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
redis basics
redis basicsredis basics
redis basics
 
A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redis
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL database
 
An Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfAn Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdf
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with Redis
 
Redis and it's data types
Redis and it's data typesRedis and it's data types
Redis and it's data types
 
Redis basics
Redis basicsRedis basics
Redis basics
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Troubleshooting redis
Troubleshooting redisTroubleshooting redis
Troubleshooting redis
 
RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ Twitter
 
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTOClickHouse Introduction by Alexander Zaitsev, Altinity CTO
ClickHouse Introduction by Alexander Zaitsev, Altinity CTO
 
Redis Reliability, Performance & Innovation
Redis Reliability, Performance & InnovationRedis Reliability, Performance & Innovation
Redis Reliability, Performance & Innovation
 
Optimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptxOptimize the performance, cost, and value of databases.pptx
Optimize the performance, cost, and value of databases.pptx
 
Introduction to Database Services
Introduction to Database ServicesIntroduction to Database Services
Introduction to Database Services
 
Redis - Usability and Use Cases
Redis - Usability and Use CasesRedis - Usability and Use Cases
Redis - Usability and Use Cases
 
Mongo DB 완벽가이드 - 4장 쿼리하기
Mongo DB 완벽가이드 - 4장 쿼리하기Mongo DB 완벽가이드 - 4장 쿼리하기
Mongo DB 완벽가이드 - 4장 쿼리하기
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
 

Viewers also liked

An Updated Performance Comparison of Virtual Machines and Linux Containers
An Updated Performance Comparison of Virtual Machines and Linux ContainersAn Updated Performance Comparison of Virtual Machines and Linux Containers
An Updated Performance Comparison of Virtual Machines and Linux ContainersKento Aoyama
 
O uso do computador na educação
O uso do computador na educaçãoO uso do computador na educação
O uso do computador na educaçãoRafael Nogueira
 
Університетське містечко ЗНУ: подорож крізь десятиліття
Університетське містечко ЗНУ: подорож крізь десятиліттяУніверситетське містечко ЗНУ: подорож крізь десятиліття
Університетське містечко ЗНУ: подорож крізь десятиліттяОлена Семенець
 
Demystifying datastores
Demystifying datastoresDemystifying datastores
Demystifying datastoresvishnu rao
 
Introduction to concurrent programming with akka actors
Introduction to concurrent programming with akka actorsIntroduction to concurrent programming with akka actors
Introduction to concurrent programming with akka actorsdatamantra
 
Golang 101 (Concurrency vs Parallelism)
Golang 101 (Concurrency vs Parallelism)Golang 101 (Concurrency vs Parallelism)
Golang 101 (Concurrency vs Parallelism)Pramesti Hatta K.
 
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...Javier Caballero
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPFAlex Maestretti
 
Introduction of Mesosphere DCOS
Introduction of Mesosphere DCOSIntroduction of Mesosphere DCOS
Introduction of Mesosphere DCOSDeughyeon Chang
 
Valeria Ramos
Valeria RamosValeria Ramos
Valeria RamosValejrd
 
Сергей Радзыняк ".NET Microservices in Real Life"
Сергей Радзыняк ".NET Microservices in Real Life"Сергей Радзыняк ".NET Microservices in Real Life"
Сергей Радзыняк ".NET Microservices in Real Life"Fwdays
 
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCorley S.r.l.
 
Introduction To Anypoint CloudHub With Mulesoft
Introduction To Anypoint CloudHub With MulesoftIntroduction To Anypoint CloudHub With Mulesoft
Introduction To Anypoint CloudHub With MulesoftJitendra Bafna
 
Redis原生命令介绍
Redis原生命令介绍Redis原生命令介绍
Redis原生命令介绍Edward Lee
 
Инновационный опыт работы центра медико-психолого-социального сопровождения с...
Инновационный опыт работы центра медико-психолого-социального сопровождения с...Инновационный опыт работы центра медико-психолого-социального сопровождения с...
Инновационный опыт работы центра медико-психолого-социального сопровождения с...Parusnik55
 

Viewers also liked (20)

An Updated Performance Comparison of Virtual Machines and Linux Containers
An Updated Performance Comparison of Virtual Machines and Linux ContainersAn Updated Performance Comparison of Virtual Machines and Linux Containers
An Updated Performance Comparison of Virtual Machines and Linux Containers
 
Sensu Monitoring
Sensu MonitoringSensu Monitoring
Sensu Monitoring
 
O uso do computador na educação
O uso do computador na educaçãoO uso do computador na educação
O uso do computador na educação
 
Introducción a la P.O.O.
Introducción a la P.O.O.Introducción a la P.O.O.
Introducción a la P.O.O.
 
Університетське містечко ЗНУ: подорож крізь десятиліття
Університетське містечко ЗНУ: подорож крізь десятиліттяУніверситетське містечко ЗНУ: подорож крізь десятиліття
Університетське містечко ЗНУ: подорож крізь десятиліття
 
ERADA M3 S1 - Business Model Design
ERADA M3 S1 - Business Model DesignERADA M3 S1 - Business Model Design
ERADA M3 S1 - Business Model Design
 
Demystifying datastores
Demystifying datastoresDemystifying datastores
Demystifying datastores
 
Introduction to concurrent programming with akka actors
Introduction to concurrent programming with akka actorsIntroduction to concurrent programming with akka actors
Introduction to concurrent programming with akka actors
 
Seo
SeoSeo
Seo
 
Golang 101 (Concurrency vs Parallelism)
Golang 101 (Concurrency vs Parallelism)Golang 101 (Concurrency vs Parallelism)
Golang 101 (Concurrency vs Parallelism)
 
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
Modèles de données types pour l'interopérabilité des systèmes de gestion acti...
 
Security Monitoring with eBPF
Security Monitoring with eBPFSecurity Monitoring with eBPF
Security Monitoring with eBPF
 
Introduction of Mesosphere DCOS
Introduction of Mesosphere DCOSIntroduction of Mesosphere DCOS
Introduction of Mesosphere DCOS
 
Valeria Ramos
Valeria RamosValeria Ramos
Valeria Ramos
 
Сергей Радзыняк ".NET Microservices in Real Life"
Сергей Радзыняк ".NET Microservices in Real Life"Сергей Радзыняк ".NET Microservices in Real Life"
Сергей Радзыняк ".NET Microservices in Real Life"
 
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented applicationCloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
CloudConf2017 - Deploy, Scale & Coordinate a microservice oriented application
 
Introduction To Anypoint CloudHub With Mulesoft
Introduction To Anypoint CloudHub With MulesoftIntroduction To Anypoint CloudHub With Mulesoft
Introduction To Anypoint CloudHub With Mulesoft
 
Redis原生命令介绍
Redis原生命令介绍Redis原生命令介绍
Redis原生命令介绍
 
A evolução do açúcar.
A evolução do açúcar.A evolução do açúcar.
A evolução do açúcar.
 
Инновационный опыт работы центра медико-психолого-социального сопровождения с...
Инновационный опыт работы центра медико-психолого-социального сопровождения с...Инновационный опыт работы центра медико-психолого-социального сопровождения с...
Инновационный опыт работы центра медико-психолого-социального сопровождения с...
 

Similar to Redis overview

Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisItamar Haber
 
Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Dinh Pham
 
#SydPHP - The Magic of Redis
#SydPHP - The Magic of Redis#SydPHP - The Magic of Redis
#SydPHP - The Magic of RedisAaron Weatherall
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redisjavier ramirez
 
Introduction to hadoop ecosystem
Introduction to hadoop ecosystem Introduction to hadoop ecosystem
Introduction to hadoop ecosystem Rupak Roy
 
Redis data structure and Performance Optimization
Redis data structure and Performance OptimizationRedis data structure and Performance Optimization
Redis data structure and Performance OptimizationKnoldus Inc.
 
2_Redis.pptx very useful for begginers yes
2_Redis.pptx very useful for begginers yes2_Redis.pptx very useful for begginers yes
2_Redis.pptx very useful for begginers yessoufianbouktaib1
 
Big Data and Hadoop
Big Data and HadoopBig Data and Hadoop
Big Data and HadoopMr. Ankit
 
mar07-redis.pdf
mar07-redis.pdfmar07-redis.pdf
mar07-redis.pdfAnisSalhi3
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)Prashant Gupta
 
Various raid levels pros & cons
Various raid levels pros & consVarious raid levels pros & cons
Various raid levels pros & consIT Tech
 
Hadoop file system
Hadoop file systemHadoop file system
Hadoop file systemJohn Veigas
 

Similar to Redis overview (20)

redis-demo.pptx
redis-demo.pptxredis-demo.pptx
redis-demo.pptx
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Redis overview
Redis overviewRedis overview
Redis overview
 
Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...
 
Redis vs Memcached
Redis vs MemcachedRedis vs Memcached
Redis vs Memcached
 
#SydPHP - The Magic of Redis
#SydPHP - The Magic of Redis#SydPHP - The Magic of Redis
#SydPHP - The Magic of Redis
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redis
 
Redis meetup
Redis meetupRedis meetup
Redis meetup
 
Introduction to hadoop ecosystem
Introduction to hadoop ecosystem Introduction to hadoop ecosystem
Introduction to hadoop ecosystem
 
Redis data structure and Performance Optimization
Redis data structure and Performance OptimizationRedis data structure and Performance Optimization
Redis data structure and Performance Optimization
 
Nextag talk
Nextag talkNextag talk
Nextag talk
 
2_Redis.pptx very useful for begginers yes
2_Redis.pptx very useful for begginers yes2_Redis.pptx very useful for begginers yes
2_Redis.pptx very useful for begginers yes
 
Big Data and Hadoop
Big Data and HadoopBig Data and Hadoop
Big Data and Hadoop
 
mar07-redis.pdf
mar07-redis.pdfmar07-redis.pdf
mar07-redis.pdf
 
Hadoop File system (HDFS)
Hadoop File system (HDFS)Hadoop File system (HDFS)
Hadoop File system (HDFS)
 
Redis and Ohm
Redis and OhmRedis and Ohm
Redis and Ohm
 
Various raid levels pros & cons
Various raid levels pros & consVarious raid levels pros & cons
Various raid levels pros & cons
 
Data storage and indexing
Data storage and indexingData storage and indexing
Data storage and indexing
 
Big Data & Hadoop
Big Data & HadoopBig Data & Hadoop
Big Data & Hadoop
 
Hadoop file system
Hadoop file systemHadoop file system
Hadoop file system
 

Recently uploaded

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 

Recently uploaded (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

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
  • 24. Good bay Created by : Ahmad EL-Khuja Akhuja@bayt.net