SlideShare a Scribd company logo
1 of 21
Download to read offline
Everybody likes
REDIS
Liviu Costea @clm160
Software Developer
Biz Pro Technologies
23.09.2015
Let me help you add Redis to your stack today!
Agenda
What’s all this with Redis?
Advanced structures (real usage scenarios)
Features, many features
How and where to use it
Bit of history
There was a developer (@antirez) and he had a problem: real
time web analytics
NOT a plain Key-value NoSql database but a in memory data
structures server
VMWare, Pivotal, RedisLabs and many other companies
helped in some way
Very popular: Twitter, Airbnb, Flickr, StackOverflow, GitHub,
BitBucket, Biz Pro Technologies and many others
How people start
First there was a server, then you think of scaling
Next you have 2 servers, but how do you share:
◦Session
◦Cached & static items
◦Sometimes you need to synchronize them
Then you find some solutions:
◦Database (probably the worst)
◦Memcached (getting better)
◦Redis (a NoSQL, newest addition)
Data structures
Main data types:
◦Strings (everything is a string)
◦Lists (double linked lists)
◦Sets (unique lists)
◦Hashes (like an object)
◦Sorted sets (by a value at creation)
Efficiently modeling of data is your main concern!
Queries
You don’t have queries, you don’t have indexes
You do have
◦KEYS = returns all your keys (EVIL I tell you!)
◦SCAN with MATCH, COUNT = server side cursor
But these are not for real queries, instead you should
keep your data updated by yourself: queries, indexes
DEMO 1
1. Data model for a voting based
website
2. Query to get all developers
from Iasi
Single threaded server
Don’t block it with long
operations (#1 threat in
production is KEYS
command)
Single threaded server
There is no locking necessary
Extremely fast, everything is in RAM
Limited support for transactions with optimistic
locking (might be removed in the future versions)
Pipelining support (check your client)
Lua scripting
Similar to stored procedures:
◦They are atomic by nature, but not transactions
◦Rule of thumb: don’t write heavy scripts because
you block the server
◦Limitation: use only deterministic functions
(because of replication model)
◦KEYS and ARGV global variables
DEMO 2
1. Sliding expiration for a simple
key
2. Increment all scores of a set
3. Distributed locking
Use as a cache system
It can be configured as a LRU cache with max memory
and different eviction policies
Expiration (TTL) of keys only (no subkeys)
Use as a session storage
If you go with the session out of proc here are some
existing session providers:
◦PHPRedis
◦Spring Session
◦Ruby
◦Node.js
◦ASP.NET (official and open source - wow)
Use as a real database
Backup – Snapshot (RDB file) - default
◦BGSave – fork
◦On Stop / On Start
Persistence - AOF
◦Every write appends
Use both, on long term they will be unified
Master / Slave replication and WAIT command
DEMO 3
1. Restarting the server, data is
not lost
2. Save on demand
3. Lets see also AOF
More features
Big ecosystem, lots of client libraries out there: redis.
io/clients
On AWS and Azure – first class citizen (with high
availability)
Windows port by MS Open Tech (good for dev)
GUIs:
Redsmin (web), Redis-commander (web, your own
installation, node.js), FastoRedis (desktop)
Redis Cluster
Available from 3.0 – waiting for adoption – clients and
applications
Implemented with query routing
Client must be (smart) able to memorize things about
the cluster: gets redirected to the right node
Ping – Pong between clients (heartbeat)
Keyspace (dividing data into nodes)
Generating KEYS in a LUA script isn’t cluster-safe
Troubleshooting
Main problems come from long running commands:
◦FLUSHDB,
◦FLUSHALL,
◦KEYS
◦LUA Scripts
◦They can even bring your replica set DOWN
DEMO 4
1. Slowlog
2. Big keys
3. Monitor
Future features
For the next version
◦Geo hashing API (already documented)
◦A few new commands: like a memory introspection
command
Other things in the queue:
◦Real transactions with Lua, support for rollback
?questions?
1. Liviu Costea
2. email.lcostea@gmail.com
3. @clm160
4. SO user:4138058

More Related Content

What's hot

OTechs Cloud Computing Training Course
OTechs Cloud Computing Training CourseOTechs Cloud Computing Training Course
OTechs Cloud Computing Training CourseOsman Suliman
 
RelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendRelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendJens Klein
 
Draft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSDraft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSAnkit Raj
 
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009eLiberatica
 
Hadoop 2.x HDFS Cluster Installation (VirtualBox)
Hadoop 2.x  HDFS Cluster Installation (VirtualBox)Hadoop 2.x  HDFS Cluster Installation (VirtualBox)
Hadoop 2.x HDFS Cluster Installation (VirtualBox)Amir Sedighi
 
Azure document db
Azure document dbAzure document db
Azure document dbIan Chen
 
Handling scientific workloads using opennebula, Roland den Hollander, VU
Handling scientific workloads using opennebula, Roland den Hollander, VUHandling scientific workloads using opennebula, Roland den Hollander, VU
Handling scientific workloads using opennebula, Roland den Hollander, VUOpenNebula Project
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.jsJames Carr
 
Rapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild sideRapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild sideSamrat Saha
 
Node in Real Time - The Beginning
Node in Real Time - The BeginningNode in Real Time - The Beginning
Node in Real Time - The BeginningAxilis
 
JavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows AzureJavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows AzureSasha Goldshtein
 
Academy PRO: Introduction to search engines. Meet Elasticsearch
Academy PRO: Introduction to search engines. Meet ElasticsearchAcademy PRO: Introduction to search engines. Meet Elasticsearch
Academy PRO: Introduction to search engines. Meet ElasticsearchBinary Studio
 
Ускоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетамиУскоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетами2ГИС Технологии
 
Supercharge your next Vue app with Nuxt
Supercharge your next Vue app with NuxtSupercharge your next Vue app with Nuxt
Supercharge your next Vue app with NuxtThe Software House
 

What's hot (20)

OTechs Cloud Computing Training Course
OTechs Cloud Computing Training CourseOTechs Cloud Computing Training Course
OTechs Cloud Computing Training Course
 
The C10k Problem
The C10k ProblemThe C10k Problem
The C10k Problem
 
RelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendRelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage Backend
 
Draft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSDraft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFS
 
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009
 
Nodejs
NodejsNodejs
Nodejs
 
Hadoop 2.x HDFS Cluster Installation (VirtualBox)
Hadoop 2.x  HDFS Cluster Installation (VirtualBox)Hadoop 2.x  HDFS Cluster Installation (VirtualBox)
Hadoop 2.x HDFS Cluster Installation (VirtualBox)
 
Azure document db
Azure document dbAzure document db
Azure document db
 
Handling scientific workloads using opennebula, Roland den Hollander, VU
Handling scientific workloads using opennebula, Roland den Hollander, VUHandling scientific workloads using opennebula, Roland den Hollander, VU
Handling scientific workloads using opennebula, Roland den Hollander, VU
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
 
Restinio (actual aug 2018)
Restinio (actual aug 2018)Restinio (actual aug 2018)
Restinio (actual aug 2018)
 
node.js
node.jsnode.js
node.js
 
Rapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild sideRapid prototyping using azure functions - A walk on the wild side
Rapid prototyping using azure functions - A walk on the wild side
 
Swarm
SwarmSwarm
Swarm
 
Node in Real Time - The Beginning
Node in Real Time - The BeginningNode in Real Time - The Beginning
Node in Real Time - The Beginning
 
Cassandra at scale
Cassandra at scaleCassandra at scale
Cassandra at scale
 
JavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows AzureJavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows Azure
 
Academy PRO: Introduction to search engines. Meet Elasticsearch
Academy PRO: Introduction to search engines. Meet ElasticsearchAcademy PRO: Introduction to search engines. Meet Elasticsearch
Academy PRO: Introduction to search engines. Meet Elasticsearch
 
Ускоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетамиУскоряем загрузку картинок вебсокетами
Ускоряем загрузку картинок вебсокетами
 
Supercharge your next Vue app with Nuxt
Supercharge your next Vue app with NuxtSupercharge your next Vue app with Nuxt
Supercharge your next Vue app with Nuxt
 

Viewers also liked

Commerical insurance presentation final 3.3.16
Commerical insurance presentation final 3.3.16Commerical insurance presentation final 3.3.16
Commerical insurance presentation final 3.3.16Jennifer Benincasa
 
L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115PaulinaKucharska
 
IG2 game audio cut sequence production_2014 to 2015
IG2 game audio cut sequence production_2014 to 2015IG2 game audio cut sequence production_2014 to 2015
IG2 game audio cut sequence production_2014 to 2015PaulinaKucharska
 
Solidarity eocnomy building alternatives for people and planet papers and rep...
Solidarity eocnomy building alternatives for people and planet papers and rep...Solidarity eocnomy building alternatives for people and planet papers and rep...
Solidarity eocnomy building alternatives for people and planet papers and rep...roland_saavedra
 
Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.
Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.
Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.Latvijas Jaunatnes padome
 
Ethanol whitepaper
Ethanol whitepaperEthanol whitepaper
Ethanol whitepaperRavi Yadav
 

Viewers also liked (12)

Mision universidad de londres
Mision universidad de londresMision universidad de londres
Mision universidad de londres
 
Commerical insurance presentation final 3.3.16
Commerical insurance presentation final 3.3.16Commerical insurance presentation final 3.3.16
Commerical insurance presentation final 3.3.16
 
L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115
 
IG2 game audio cut sequence production_2014 to 2015
IG2 game audio cut sequence production_2014 to 2015IG2 game audio cut sequence production_2014 to 2015
IG2 game audio cut sequence production_2014 to 2015
 
1000 Lens Campaign
1000 Lens Campaign1000 Lens Campaign
1000 Lens Campaign
 
Solidarity eocnomy building alternatives for people and planet papers and rep...
Solidarity eocnomy building alternatives for people and planet papers and rep...Solidarity eocnomy building alternatives for people and planet papers and rep...
Solidarity eocnomy building alternatives for people and planet papers and rep...
 
Youth Policy for NEETs
Youth Policy for NEETsYouth Policy for NEETs
Youth Policy for NEETs
 
Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.
Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.
Jauniešu garantijas projektu konkurss pašvaldībām, JSPA, 12.11.2014.
 
Jauniešu politiskā līdzdalība Latvijā.
Jauniešu politiskā līdzdalība Latvijā.Jauniešu politiskā līdzdalība Latvijā.
Jauniešu politiskā līdzdalība Latvijā.
 
Lesson template
Lesson templateLesson template
Lesson template
 
Manualmaster,0
Manualmaster,0Manualmaster,0
Manualmaster,0
 
Ethanol whitepaper
Ethanol whitepaperEthanol whitepaper
Ethanol whitepaper
 

Similar to dba_lounge_Iasi: Everybody likes redis

Planning for-high-performance-web-application
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-applicationNguyễn Duy Nhân
 
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Maarten Balliauw
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecturejoaquincasares
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]Huy Do
 
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...South Tyrol Free Software Conference
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBob Ward
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...javier ramirez
 
Exploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeExploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeFrancis Alexander
 
Azure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerAzure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerRafał Hryniewski
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceAshok Modi
 
Bootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxBootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxMaximiliano Accotto
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...javier ramirez
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamBrian Benz
 
Redis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHPRedis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHPRicard Clau
 
Planning For High Performance Web Application
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web ApplicationYue Tian
 
Quick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterQuick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterPatrick Quairoli
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP LondonRicard Clau
 
Build an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data ScientistsBuild an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data ScientistsShawn Zhu
 

Similar to dba_lounge_Iasi: Everybody likes redis (20)

Planning for-high-performance-web-application
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-application
 
SQL on linux
SQL on linuxSQL on linux
SQL on linux
 
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo)
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
 
NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
 
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ...
 
In-memory Databases
In-memory DatabasesIn-memory Databases
In-memory Databases
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ...
 
Exploiting NoSQL Like Never Before
Exploiting NoSQL Like Never BeforeExploiting NoSQL Like Never Before
Exploiting NoSQL Like Never Before
 
Azure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL ServerAzure SQL - more or/and less than SQL Server
Azure SQL - more or/and less than SQL Server
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
 
Bootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxBootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on Linux
 
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ...
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
 
Redis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHPRedis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHP
 
Planning For High Performance Web Application
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web Application
 
Quick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage ClusterQuick-and-Easy Deployment of a Ceph Storage Cluster
Quick-and-Easy Deployment of a Ceph Storage Cluster
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Build an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data ScientistsBuild an Open Source Data Lake For Data Scientists
Build an Open Source Data Lake For Data Scientists
 

Recently uploaded

Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonApplitools
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesVictoriaMetrics
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolsosttopstonverter
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptxVinzoCenzo
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...OnePlan Solutions
 

Recently uploaded (20)

Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + KobitonLeveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
 
What’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 UpdatesWhat’s New in VictoriaMetrics: Q1 2024 Updates
What’s New in VictoriaMetrics: Q1 2024 Updates
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
eSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration toolseSoftTools IMAP Backup Software and migration tools
eSoftTools IMAP Backup Software and migration tools
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News UpdateVictoriaMetrics Q1 Meet Up '24 - Community & News Update
VictoriaMetrics Q1 Meet Up '24 - Community & News Update
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Osi security architecture in network.pptx
Osi security architecture in network.pptxOsi security architecture in network.pptx
Osi security architecture in network.pptx
 
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
Tech Tuesday Slides - Introduction to Project Management with OnePlan's Work ...
 

dba_lounge_Iasi: Everybody likes redis

  • 1. Everybody likes REDIS Liviu Costea @clm160 Software Developer Biz Pro Technologies 23.09.2015 Let me help you add Redis to your stack today!
  • 2. Agenda What’s all this with Redis? Advanced structures (real usage scenarios) Features, many features How and where to use it
  • 3. Bit of history There was a developer (@antirez) and he had a problem: real time web analytics NOT a plain Key-value NoSql database but a in memory data structures server VMWare, Pivotal, RedisLabs and many other companies helped in some way Very popular: Twitter, Airbnb, Flickr, StackOverflow, GitHub, BitBucket, Biz Pro Technologies and many others
  • 4. How people start First there was a server, then you think of scaling Next you have 2 servers, but how do you share: ◦Session ◦Cached & static items ◦Sometimes you need to synchronize them Then you find some solutions: ◦Database (probably the worst) ◦Memcached (getting better) ◦Redis (a NoSQL, newest addition)
  • 5. Data structures Main data types: ◦Strings (everything is a string) ◦Lists (double linked lists) ◦Sets (unique lists) ◦Hashes (like an object) ◦Sorted sets (by a value at creation) Efficiently modeling of data is your main concern!
  • 6. Queries You don’t have queries, you don’t have indexes You do have ◦KEYS = returns all your keys (EVIL I tell you!) ◦SCAN with MATCH, COUNT = server side cursor But these are not for real queries, instead you should keep your data updated by yourself: queries, indexes
  • 7. DEMO 1 1. Data model for a voting based website 2. Query to get all developers from Iasi
  • 8. Single threaded server Don’t block it with long operations (#1 threat in production is KEYS command)
  • 9. Single threaded server There is no locking necessary Extremely fast, everything is in RAM Limited support for transactions with optimistic locking (might be removed in the future versions) Pipelining support (check your client)
  • 10. Lua scripting Similar to stored procedures: ◦They are atomic by nature, but not transactions ◦Rule of thumb: don’t write heavy scripts because you block the server ◦Limitation: use only deterministic functions (because of replication model) ◦KEYS and ARGV global variables
  • 11. DEMO 2 1. Sliding expiration for a simple key 2. Increment all scores of a set 3. Distributed locking
  • 12. Use as a cache system It can be configured as a LRU cache with max memory and different eviction policies Expiration (TTL) of keys only (no subkeys)
  • 13. Use as a session storage If you go with the session out of proc here are some existing session providers: ◦PHPRedis ◦Spring Session ◦Ruby ◦Node.js ◦ASP.NET (official and open source - wow)
  • 14. Use as a real database Backup – Snapshot (RDB file) - default ◦BGSave – fork ◦On Stop / On Start Persistence - AOF ◦Every write appends Use both, on long term they will be unified Master / Slave replication and WAIT command
  • 15. DEMO 3 1. Restarting the server, data is not lost 2. Save on demand 3. Lets see also AOF
  • 16. More features Big ecosystem, lots of client libraries out there: redis. io/clients On AWS and Azure – first class citizen (with high availability) Windows port by MS Open Tech (good for dev) GUIs: Redsmin (web), Redis-commander (web, your own installation, node.js), FastoRedis (desktop)
  • 17. Redis Cluster Available from 3.0 – waiting for adoption – clients and applications Implemented with query routing Client must be (smart) able to memorize things about the cluster: gets redirected to the right node Ping – Pong between clients (heartbeat) Keyspace (dividing data into nodes) Generating KEYS in a LUA script isn’t cluster-safe
  • 18. Troubleshooting Main problems come from long running commands: ◦FLUSHDB, ◦FLUSHALL, ◦KEYS ◦LUA Scripts ◦They can even bring your replica set DOWN
  • 19. DEMO 4 1. Slowlog 2. Big keys 3. Monitor
  • 20. Future features For the next version ◦Geo hashing API (already documented) ◦A few new commands: like a memory introspection command Other things in the queue: ◦Real transactions with Lua, support for rollback
  • 21. ?questions? 1. Liviu Costea 2. email.lcostea@gmail.com 3. @clm160 4. SO user:4138058