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

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
 
Redis Overview
Redis OverviewRedis Overview
Redis OverviewHoang Long
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redisZhichao Liang
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with RedisGeorge Platon
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAli MasudianPour
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practiceEugene Fidelin
 
Scaling Hadoop at LinkedIn
Scaling Hadoop at LinkedInScaling Hadoop at LinkedIn
Scaling Hadoop at LinkedInDataWorks Summit
 
Redis cluster
Redis clusterRedis cluster
Redis clusteriammutex
 
Redis vs. MongoDB: Comparing In-Memory Databases with Percona Memory Engine
Redis vs. MongoDB: Comparing In-Memory Databases with Percona Memory EngineRedis vs. MongoDB: Comparing In-Memory Databases with Percona Memory Engine
Redis vs. MongoDB: Comparing In-Memory Databases with Percona Memory EngineScaleGrid.io
 
Redis in Practice
Redis in PracticeRedis in Practice
Redis in PracticeNoah Davis
 
Redis and its Scaling and Obersvability
Redis and its Scaling and ObersvabilityRedis and its Scaling and Obersvability
Redis and its Scaling and ObersvabilityAbhishekDubey902839
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisKnoldus Inc.
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바NeoClova
 
New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12Sergey Petrunya
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup IntroductionGregory Boissinot
 
Introduction of Redis as NoSQL Database
Introduction of Redis as NoSQL DatabaseIntroduction of Redis as NoSQL Database
Introduction of Redis as NoSQL DatabaseAbhijeet Shekhar
 

What's hot (20)

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
 
Redis Overview
Redis OverviewRedis Overview
Redis Overview
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redis
 
Caching solutions with Redis
Caching solutions   with RedisCaching solutions   with Redis
Caching solutions with Redis
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL database
 
Redis database
Redis databaseRedis database
Redis database
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
 
Redis Persistence
Redis  PersistenceRedis  Persistence
Redis Persistence
 
Scaling Hadoop at LinkedIn
Scaling Hadoop at LinkedInScaling Hadoop at LinkedIn
Scaling Hadoop at LinkedIn
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Redis vs. MongoDB: Comparing In-Memory Databases with Percona Memory Engine
Redis vs. MongoDB: Comparing In-Memory Databases with Percona Memory EngineRedis vs. MongoDB: Comparing In-Memory Databases with Percona Memory Engine
Redis vs. MongoDB: Comparing In-Memory Databases with Percona Memory Engine
 
Redis in Practice
Redis in PracticeRedis in Practice
Redis in Practice
 
Redis and its Scaling and Obersvability
Redis and its Scaling and ObersvabilityRedis and its Scaling and Obersvability
Redis and its Scaling and Obersvability
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바MariaDB 마이그레이션 - 네오클로바
MariaDB 마이그레이션 - 네오클로바
 
New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12New optimizer features in MariaDB releases before 10.12
New optimizer features in MariaDB releases before 10.12
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup Introduction
 
Introduction of Redis as NoSQL Database
Introduction of Redis as NoSQL DatabaseIntroduction of Redis as NoSQL Database
Introduction of Redis as NoSQL Database
 
Apache phoenix
Apache phoenixApache phoenix
Apache phoenix
 

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

API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
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
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformWSO2
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 

Recently uploaded (20)

API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
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...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 

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