ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
REDIS:
INSTALLATION,
CONFIGURATION &
IMPLEMENTATION
Everything and Anything I.T
By
Abhijeet Shekhar
Installation
Linux: http://redis.io/download
Windows
1. Clone from Git repo:
https://github.com/MSOpenTech/redis
2. Unzip file from /redis/bin/release
(e.g. redisbin64.zip) to /redis
3. Important files:
? /redis/redis-server.exe
? /redis/redis-cli.exe
Configuration
? Configuration file: /redis/redis.conf
? It is possible to change a port (if you wish):
? For development environment it is useful to
change data persisting policy
port 6379
save 900 1
save 300 10
save 60 10000
save 10 1
save after 10 sec if at least 1 key changed
Running Redis Server
? Run /redis/bin/redis-server.exe and
specify configuration file to use
redis>redis-server redis.conf
Running Redis Client
? Run /redis/bin/redis-cli.exe
? Now you can play with Redis a little bit
Useful Commands
? Print all keys:
? Remove all keys from all databases
? Synchronously save the dataset to disk
KEYS *
FLUSHALL
SAVE
Redis keys
? Keys are binary safe - it is possible to use any
binary sequence as a key
? The empty string is also a valid key
? Too long keys are not a good idea
? Too short keys are often also not a good idea
("u:1000:pwd" versus "user:1000:password")
? Nice idea is to use some kind of schema, like:
"object-type:id:field"
Redis data types
Redis is often referred to as a data structure
server since keys can contain:
? Strings
? Lists
? Sets
? Hashes
? Sorted Sets
Redis Strings: Example
Redis Lists
? Lists of strings, sorted by insertion order
? Add elements to a Redis List pushing new
elements on the head (on the left) or on the tail
(on the right) of the list
? Max length: (2^32 - 1) elements
? Model a timeline in a social network, using LPUSH
to add new elements, and using LRANGE in order
to retrieve recent items
? Use LPUSH together with LTRIM to create a list
that never exceeds a given number of elements
Redis Lists: Example
Redis Sorted Sets
? Every member of a Sorted Set is associated with
score, that is used in order to take the sorted set
ordered, from the smallest to the greatest score
? You can do a lot of tasks with great performance
that are really hard to model in other kind of
databases
? Probably the most advanced Redis data type
Redis Hashes
? Map between string fields and string values
? Perfect data type to represent objects
HMSET user:1000 username abhi password 123 age 28
HGETALL user:1000
HSET user:1000 password 12345
HGETALL user:1000
Redis Operations
It is possible to run atomic operations on data
types:
? appending to a string
? incrementing the value in a hash
? pushing to a list
? computing set intersection, union and difference
? getting the member with highest ranking in a
sorted set
Redis client
? PHPRedis ¨C PHP Client for Redis
(https://github.com/nicolasff/phpredis)
? JRedis - Java Client for Redis
? Jedis - a blazingly small and sane Redis Java client
? Spring Data Redis
Configuration
By Redis.conf
port 6379
bind 127.0.0.1
maxclients 10000
maxmemory <bytes>
By script
$redis->config("GET", "*max-*-entries*");
$redis->config("SET", "dir",
"/var/run/redis/dumps/");
PHP code
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->set('key','value', 10); // Will set the key, if it
doesn't exist, with a ttl of 10 seconds
echo $redis->get(¡®key¡¯);
?>
Thanks ?

More Related Content

Similar to Redis Installation Configuration And Implementation (20)

quickguide-einnovator-9-redis
quickguide-einnovator-9-redisquickguide-einnovator-9-redis
quickguide-einnovator-9-redis
jorgesimao71
?
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
Tanu Siwag
?
Redispresentation apac2012
Redispresentation apac2012Redispresentation apac2012
Redispresentation apac2012
Ankur Gupta
?
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Itamar Haber
?
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redis
javier ramirez
?
Redis
RedisRedis
Redis
ssuserbad56d
?
Redis
RedisRedis
Redis
Rajesh Kumar
?
Extend Redis with Modules
Extend Redis with ModulesExtend Redis with Modules
Extend Redis with Modules
Itamar Haber
?
Redis introduction
Redis introductionRedis introduction
Redis introduction
Federico Daniel Colombo Gennarelli
?
Developing a Redis Module - Hackathon Kickoff
 Developing a Redis Module - Hackathon Kickoff Developing a Redis Module - Hackathon Kickoff
Developing a Redis Module - Hackathon Kickoff
Itamar Haber
?
Redis overview
Redis overviewRedis overview
Redis overview
Ashokkumar T A
?
Work Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim NelsonWork Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim Nelson
Redis Labs
?
Red Hat Certified engineer course
  Red Hat Certified engineer course   Red Hat Certified engineer course
Red Hat Certified engineer course
Ali Abdo
?
Linux_Commands_MT.pdf
Linux_Commands_MT.pdfLinux_Commands_MT.pdf
Linux_Commands_MT.pdf
RameshN849679
?
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Paddy Lock
?
Redis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering MeetupRedis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering Meetup
Abhishek Goswami
?
Redis basics
Redis basicsRedis basics
Redis basics
Arthur Shvetsov
?
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
Itamar Haber
?
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
NexThoughts Technologies
?
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
Kavya Sri
?
quickguide-einnovator-9-redis
quickguide-einnovator-9-redisquickguide-einnovator-9-redis
quickguide-einnovator-9-redis
jorgesimao71
?
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
Tanu Siwag
?
Redispresentation apac2012
Redispresentation apac2012Redispresentation apac2012
Redispresentation apac2012
Ankur Gupta
?
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Itamar Haber
?
Extend Redis with Modules
Extend Redis with ModulesExtend Redis with Modules
Extend Redis with Modules
Itamar Haber
?
Developing a Redis Module - Hackathon Kickoff
 Developing a Redis Module - Hackathon Kickoff Developing a Redis Module - Hackathon Kickoff
Developing a Redis Module - Hackathon Kickoff
Itamar Haber
?
Work Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim NelsonWork Stealing For Fun & Profit: Jim Nelson
Work Stealing For Fun & Profit: Jim Nelson
Redis Labs
?
Red Hat Certified engineer course
  Red Hat Certified engineer course   Red Hat Certified engineer course
Red Hat Certified engineer course
Ali Abdo
?
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Paddy Lock
?
Redis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering MeetupRedis. Seattle Data Science and Data Engineering Meetup
Redis. Seattle Data Science and Data Engineering Meetup
Abhishek Goswami
?
Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)Redis Use Patterns (DevconTLV June 2014)
Redis Use Patterns (DevconTLV June 2014)
Itamar Haber
?
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
Kavya Sri
?

Recently uploaded (20)

Tour Booking, Booking Service, Tour Agents, Hotel Booking in odoo
Tour Booking, Booking Service, Tour Agents, Hotel Booking in odooTour Booking, Booking Service, Tour Agents, Hotel Booking in odoo
Tour Booking, Booking Service, Tour Agents, Hotel Booking in odoo
AxisTechnolabs
?
6 Best AI Tools for Contract Management.pdf
6 Best AI Tools for Contract Management.pdf6 Best AI Tools for Contract Management.pdf
6 Best AI Tools for Contract Management.pdf
Anadea
?
mORMot 2 - Pascal Cafe 2025 in Nederlands
mORMot 2 - Pascal Cafe 2025 in NederlandsmORMot 2 - Pascal Cafe 2025 in Nederlands
mORMot 2 - Pascal Cafe 2025 in Nederlands
Arnaud Bouchez
?
Digital Application Development Services
Digital Application Development ServicesDigital Application Development Services
Digital Application Development Services
daavishenry
?
Wondershare Filmora 14.3.2.11147 crack
Wondershare Filmora   14.3.2.11147 crackWondershare Filmora   14.3.2.11147 crack
Wondershare Filmora 14.3.2.11147 crack
blouch51kp
?
Marketo User Group - Singapore - April 2025
Marketo User Group - Singapore - April 2025Marketo User Group - Singapore - April 2025
Marketo User Group - Singapore - April 2025
BradBedford3
?
Lumion Pro Crack latest version Free 2025
Lumion Pro Crack latest version Free 2025Lumion Pro Crack latest version Free 2025
Lumion Pro Crack latest version Free 2025
naeem55ddf
?
The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...
The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...
The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...
Imma Valls Bernaus
?
The Open-Closed Principle - Part 2 - The Contemporary Version - An Introduction
The Open-Closed Principle - Part 2 - The Contemporary Version - An IntroductionThe Open-Closed Principle - Part 2 - The Contemporary Version - An Introduction
The Open-Closed Principle - Part 2 - The Contemporary Version - An Introduction
Philip Schwarz
?
Internet Download Manager Crack Latest version 2025
Internet Download Manager  Crack Latest version 2025Internet Download Manager  Crack Latest version 2025
Internet Download Manager Crack Latest version 2025
mohsinrazakpa26
?
New-4K Video Downloader Crack + License Key 2025
New-4K Video Downloader Crack + License Key 2025New-4K Video Downloader Crack + License Key 2025
New-4K Video Downloader Crack + License Key 2025
abbaskanju3
?
wAIred_VoxxedDaysAmsterdam_03042025.pptx
wAIred_VoxxedDaysAmsterdam_03042025.pptxwAIred_VoxxedDaysAmsterdam_03042025.pptx
wAIred_VoxxedDaysAmsterdam_03042025.pptx
SimonedeGijt
?
Windows 8.1 Pro Activator Crack Version [April-2025]
Windows 8.1 Pro Activator Crack Version [April-2025]Windows 8.1 Pro Activator Crack Version [April-2025]
Windows 8.1 Pro Activator Crack Version [April-2025]
jhonjosh91
?
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
anglekaan18
?
4K Video Downloader Crack + License Key 2025
4K Video Downloader Crack + License Key 20254K Video Downloader Crack + License Key 2025
4K Video Downloader Crack + License Key 2025
yelenayoko
?
IObit Driver Booster Free 12.3.0.557 Free Download
IObit Driver Booster Free 12.3.0.557 Free DownloadIObit Driver Booster Free 12.3.0.557 Free Download
IObit Driver Booster Free 12.3.0.557 Free Download
blouch33kp
?
Coreldraw 2021 Crack Latest Version 2025
Coreldraw 2021 Crack Latest Version 2025Coreldraw 2021 Crack Latest Version 2025
Coreldraw 2021 Crack Latest Version 2025
farooq048kp
?
Typing Master Pro 12 Crack Updated Version [April-2025]
Typing Master Pro 12 Crack Updated Version [April-2025]Typing Master Pro 12 Crack Updated Version [April-2025]
Typing Master Pro 12 Crack Updated Version [April-2025]
jhonjosh91
?
microsoft office 2019 crack free download
microsoft office 2019 crack free downloadmicrosoft office 2019 crack free download
microsoft office 2019 crack free download
mohsinrazakpa39
?
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
mohsinrazakpa28
?
Tour Booking, Booking Service, Tour Agents, Hotel Booking in odoo
Tour Booking, Booking Service, Tour Agents, Hotel Booking in odooTour Booking, Booking Service, Tour Agents, Hotel Booking in odoo
Tour Booking, Booking Service, Tour Agents, Hotel Booking in odoo
AxisTechnolabs
?
6 Best AI Tools for Contract Management.pdf
6 Best AI Tools for Contract Management.pdf6 Best AI Tools for Contract Management.pdf
6 Best AI Tools for Contract Management.pdf
Anadea
?
mORMot 2 - Pascal Cafe 2025 in Nederlands
mORMot 2 - Pascal Cafe 2025 in NederlandsmORMot 2 - Pascal Cafe 2025 in Nederlands
mORMot 2 - Pascal Cafe 2025 in Nederlands
Arnaud Bouchez
?
Digital Application Development Services
Digital Application Development ServicesDigital Application Development Services
Digital Application Development Services
daavishenry
?
Wondershare Filmora 14.3.2.11147 crack
Wondershare Filmora   14.3.2.11147 crackWondershare Filmora   14.3.2.11147 crack
Wondershare Filmora 14.3.2.11147 crack
blouch51kp
?
Marketo User Group - Singapore - April 2025
Marketo User Group - Singapore - April 2025Marketo User Group - Singapore - April 2025
Marketo User Group - Singapore - April 2025
BradBedford3
?
Lumion Pro Crack latest version Free 2025
Lumion Pro Crack latest version Free 2025Lumion Pro Crack latest version Free 2025
Lumion Pro Crack latest version Free 2025
naeem55ddf
?
The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...
The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...
The Missing Voices: Unearthing the Impact of Survivorship Bias on Women in Te...
Imma Valls Bernaus
?
The Open-Closed Principle - Part 2 - The Contemporary Version - An Introduction
The Open-Closed Principle - Part 2 - The Contemporary Version - An IntroductionThe Open-Closed Principle - Part 2 - The Contemporary Version - An Introduction
The Open-Closed Principle - Part 2 - The Contemporary Version - An Introduction
Philip Schwarz
?
Internet Download Manager Crack Latest version 2025
Internet Download Manager  Crack Latest version 2025Internet Download Manager  Crack Latest version 2025
Internet Download Manager Crack Latest version 2025
mohsinrazakpa26
?
New-4K Video Downloader Crack + License Key 2025
New-4K Video Downloader Crack + License Key 2025New-4K Video Downloader Crack + License Key 2025
New-4K Video Downloader Crack + License Key 2025
abbaskanju3
?
wAIred_VoxxedDaysAmsterdam_03042025.pptx
wAIred_VoxxedDaysAmsterdam_03042025.pptxwAIred_VoxxedDaysAmsterdam_03042025.pptx
wAIred_VoxxedDaysAmsterdam_03042025.pptx
SimonedeGijt
?
Windows 8.1 Pro Activator Crack Version [April-2025]
Windows 8.1 Pro Activator Crack Version [April-2025]Windows 8.1 Pro Activator Crack Version [April-2025]
Windows 8.1 Pro Activator Crack Version [April-2025]
jhonjosh91
?
Wondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free DownloadWondershare Filmora 14.3.2 Crack + License Key Free Download
Wondershare Filmora 14.3.2 Crack + License Key Free Download
anglekaan18
?
4K Video Downloader Crack + License Key 2025
4K Video Downloader Crack + License Key 20254K Video Downloader Crack + License Key 2025
4K Video Downloader Crack + License Key 2025
yelenayoko
?
IObit Driver Booster Free 12.3.0.557 Free Download
IObit Driver Booster Free 12.3.0.557 Free DownloadIObit Driver Booster Free 12.3.0.557 Free Download
IObit Driver Booster Free 12.3.0.557 Free Download
blouch33kp
?
Coreldraw 2021 Crack Latest Version 2025
Coreldraw 2021 Crack Latest Version 2025Coreldraw 2021 Crack Latest Version 2025
Coreldraw 2021 Crack Latest Version 2025
farooq048kp
?
Typing Master Pro 12 Crack Updated Version [April-2025]
Typing Master Pro 12 Crack Updated Version [April-2025]Typing Master Pro 12 Crack Updated Version [April-2025]
Typing Master Pro 12 Crack Updated Version [April-2025]
jhonjosh91
?
microsoft office 2019 crack free download
microsoft office 2019 crack free downloadmicrosoft office 2019 crack free download
microsoft office 2019 crack free download
mohsinrazakpa39
?
Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025Wondershare Dr.Fone Crack Free Download 2025
Wondershare Dr.Fone Crack Free Download 2025
mohsinrazakpa28
?

Redis Installation Configuration And Implementation

  • 2. Installation Linux: http://redis.io/download Windows 1. Clone from Git repo: https://github.com/MSOpenTech/redis 2. Unzip file from /redis/bin/release (e.g. redisbin64.zip) to /redis 3. Important files: ? /redis/redis-server.exe ? /redis/redis-cli.exe
  • 3. Configuration ? Configuration file: /redis/redis.conf ? It is possible to change a port (if you wish): ? For development environment it is useful to change data persisting policy port 6379 save 900 1 save 300 10 save 60 10000 save 10 1 save after 10 sec if at least 1 key changed
  • 4. Running Redis Server ? Run /redis/bin/redis-server.exe and specify configuration file to use redis>redis-server redis.conf
  • 5. Running Redis Client ? Run /redis/bin/redis-cli.exe ? Now you can play with Redis a little bit
  • 6. Useful Commands ? Print all keys: ? Remove all keys from all databases ? Synchronously save the dataset to disk KEYS * FLUSHALL SAVE
  • 7. Redis keys ? Keys are binary safe - it is possible to use any binary sequence as a key ? The empty string is also a valid key ? Too long keys are not a good idea ? Too short keys are often also not a good idea ("u:1000:pwd" versus "user:1000:password") ? Nice idea is to use some kind of schema, like: "object-type:id:field"
  • 8. Redis data types Redis is often referred to as a data structure server since keys can contain: ? Strings ? Lists ? Sets ? Hashes ? Sorted Sets
  • 10. Redis Lists ? Lists of strings, sorted by insertion order ? Add elements to a Redis List pushing new elements on the head (on the left) or on the tail (on the right) of the list ? Max length: (2^32 - 1) elements ? Model a timeline in a social network, using LPUSH to add new elements, and using LRANGE in order to retrieve recent items ? Use LPUSH together with LTRIM to create a list that never exceeds a given number of elements
  • 12. Redis Sorted Sets ? Every member of a Sorted Set is associated with score, that is used in order to take the sorted set ordered, from the smallest to the greatest score ? You can do a lot of tasks with great performance that are really hard to model in other kind of databases ? Probably the most advanced Redis data type
  • 13. Redis Hashes ? Map between string fields and string values ? Perfect data type to represent objects HMSET user:1000 username abhi password 123 age 28 HGETALL user:1000 HSET user:1000 password 12345 HGETALL user:1000
  • 14. Redis Operations It is possible to run atomic operations on data types: ? appending to a string ? incrementing the value in a hash ? pushing to a list ? computing set intersection, union and difference ? getting the member with highest ranking in a sorted set
  • 15. Redis client ? PHPRedis ¨C PHP Client for Redis (https://github.com/nicolasff/phpredis) ? JRedis - Java Client for Redis ? Jedis - a blazingly small and sane Redis Java client ? Spring Data Redis
  • 16. Configuration By Redis.conf port 6379 bind 127.0.0.1 maxclients 10000 maxmemory <bytes> By script $redis->config("GET", "*max-*-entries*"); $redis->config("SET", "dir", "/var/run/redis/dumps/");
  • 17. PHP code <?php $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->set('key','value', 10); // Will set the key, if it doesn't exist, with a ttl of 10 seconds echo $redis->get(¡®key¡¯); ?>