dba_lounge_Iasi: Everybody likes redis

Liviu Costea
Liviu CosteaDevelopment Lead at BizPro Technologies um BizPro Technologies
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
1 von 21

Recomendados

Easy access to open stack object storage von
Easy access to open stack object storageEasy access to open stack object storage
Easy access to open stack object storageJuan José Martínez
3K views12 Folien
Distributed Data Processing Workshop - SBU von
Distributed Data Processing Workshop - SBUDistributed Data Processing Workshop - SBU
Distributed Data Processing Workshop - SBUAmir Sedighi
9.2K views23 Folien
Introduction to mongo db von
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo dbNexThoughts Technologies
399 views26 Folien
Intro Couchdb von
Intro CouchdbIntro Couchdb
Intro Couchdbselvamanisampath
945 views35 Folien
An Introduction to Elasticsearch for Beginners von
An Introduction to Elasticsearch for BeginnersAn Introduction to Elasticsearch for Beginners
An Introduction to Elasticsearch for BeginnersAmir Sedighi
9.9K views71 Folien
MongoDB Devops Madrid February 2012 von
MongoDB Devops Madrid February 2012MongoDB Devops Madrid February 2012
MongoDB Devops Madrid February 2012Juan Vicente Herrera Ruiz de Alejo
750 views19 Folien

Más contenido relacionado

Was ist angesagt?

OTechs Cloud Computing Training Course von
OTechs Cloud Computing Training CourseOTechs Cloud Computing Training Course
OTechs Cloud Computing Training CourseOsman Suliman
550 views11 Folien
The C10k Problem von
The C10k ProblemThe C10k Problem
The C10k ProblemSubhadra Sundar Chakraborty
1.4K views15 Folien
RelStorage Plone Zope RDB Storage Backend von
RelStorage Plone Zope RDB Storage BackendRelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage BackendJens Klein
135 views10 Folien
Draft slide of Demystifying DHT in GlusterFS von
Draft slide of Demystifying DHT in GlusterFSDraft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSAnkit Raj
261 views8 Folien
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009 von
"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
356 views21 Folien
Nodejs von
NodejsNodejs
NodejsKishore Yekkanti
814 views14 Folien

Was ist angesagt?(20)

OTechs Cloud Computing Training Course von Osman Suliman
OTechs Cloud Computing Training CourseOTechs Cloud Computing Training Course
OTechs Cloud Computing Training Course
Osman Suliman550 views
RelStorage Plone Zope RDB Storage Backend von Jens Klein
RelStorage Plone Zope RDB Storage BackendRelStorage Plone Zope RDB Storage Backend
RelStorage Plone Zope RDB Storage Backend
Jens Klein135 views
Draft slide of Demystifying DHT in GlusterFS von Ankit Raj
Draft slide of Demystifying DHT in GlusterFSDraft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFS
Ankit Raj261 views
"Clouds on the Horizon Get Ready for Drizzle" by David Axmark @ eLiberatica 2009 von eLiberatica
"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
eLiberatica356 views
Hadoop 2.x HDFS Cluster Installation (VirtualBox) von Amir Sedighi
Hadoop 2.x  HDFS Cluster Installation (VirtualBox)Hadoop 2.x  HDFS Cluster Installation (VirtualBox)
Hadoop 2.x HDFS Cluster Installation (VirtualBox)
Amir Sedighi9.7K views
Azure document db von Ian Chen
Azure document dbAzure document db
Azure document db
Ian Chen48 views
Handling scientific workloads using opennebula, Roland den Hollander, VU von OpenNebula Project
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
OpenNebula Project484 views
Intro to Node.js von James Carr
Intro to Node.jsIntro to Node.js
Intro to Node.js
James Carr1.3K views
node.js von NepalAdz
node.jsnode.js
node.js
NepalAdz790 views
Rapid prototyping using azure functions - A walk on the wild side von Samrat Saha
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
Samrat Saha179 views
Node in Real Time - The Beginning von Axilis
Node in Real Time - The BeginningNode in Real Time - The Beginning
Node in Real Time - The Beginning
Axilis389 views
JavaScript, Meet Cloud: Node.js on Windows Azure von Sasha Goldshtein
JavaScript, Meet Cloud: Node.js on Windows AzureJavaScript, Meet Cloud: Node.js on Windows Azure
JavaScript, Meet Cloud: Node.js on Windows Azure
Sasha Goldshtein3.4K views
Academy PRO: Introduction to search engines. Meet Elasticsearch von Binary Studio
Academy PRO: Introduction to search engines. Meet ElasticsearchAcademy PRO: Introduction to search engines. Meet Elasticsearch
Academy PRO: Introduction to search engines. Meet Elasticsearch
Binary Studio106 views

Destacado

Mision universidad de londres von
Mision universidad de londresMision universidad de londres
Mision universidad de londresAdlai Lopez Velazquez
218 views9 Folien
Commerical insurance presentation final 3.3.16 von
Commerical insurance presentation final 3.3.16Commerical insurance presentation final 3.3.16
Commerical insurance presentation final 3.3.16Jennifer Benincasa
703 views25 Folien
L3 gd ha3_the_structureofthegame_050115 von
L3 gd ha3_the_structureofthegame_050115L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115PaulinaKucharska
212 views4 Folien
IG2 game audio cut sequence production_2014 to 2015 von
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
123 views6 Folien
1000 Lens Campaign von
1000 Lens Campaign1000 Lens Campaign
1000 Lens CampaignMichelle Secoa
236 views14 Folien
Solidarity eocnomy building alternatives for people and planet papers and rep... von
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
1.3K views441 Folien

Destacado(12)

Commerical insurance presentation final 3.3.16 von Jennifer Benincasa
Commerical insurance presentation final 3.3.16Commerical insurance presentation final 3.3.16
Commerical insurance presentation final 3.3.16
Jennifer Benincasa703 views
L3 gd ha3_the_structureofthegame_050115 von PaulinaKucharska
L3 gd ha3_the_structureofthegame_050115L3 gd ha3_the_structureofthegame_050115
L3 gd ha3_the_structureofthegame_050115
PaulinaKucharska212 views
IG2 game audio cut sequence production_2014 to 2015 von PaulinaKucharska
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
PaulinaKucharska123 views
Solidarity eocnomy building alternatives for people and planet papers and rep... von roland_saavedra
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_saavedra1.3K views
Ethanol whitepaper von Ravi Yadav
Ethanol whitepaperEthanol whitepaper
Ethanol whitepaper
Ravi Yadav243 views

Similar a dba_lounge_Iasi: Everybody likes redis

Planning for-high-performance-web-application von
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-applicationNguyễn Duy Nhân
1.8K views44 Folien
SQL on linux von
SQL on linuxSQL on linux
SQL on linuxMaximiliano Accotto
64 views23 Folien
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo) von
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
2.8K views42 Folien
Austin Web Architecture von
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecturejoaquincasares
349 views38 Folien
NoSQL for great good [hanoi.rb talk] von
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]Huy Do
1.3K views40 Folien
SFScon14: Schrödinger’s elephant: why PostgreSQL can solve all your database ... von
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
691 views18 Folien

Similar a dba_lounge_Iasi: Everybody likes redis(20)

Planning for-high-performance-web-application von Nguyễn Duy Nhân
Planning for-high-performance-web-applicationPlanning for-high-performance-web-application
Planning for-high-performance-web-application
Nguyễn Duy Nhân1.8K views
Get more than a cache back! The Microsoft Azure Redis Cache (NDC Oslo) von Maarten Balliauw
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 Balliauw2.8K views
NoSQL for great good [hanoi.rb talk] von Huy Do
NoSQL for great good [hanoi.rb talk]NoSQL for great good [hanoi.rb talk]
NoSQL for great good [hanoi.rb talk]
Huy Do1.3K views
Brk2051 sql server on linux and docker von Bob Ward
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
Bob Ward2.7K views
Ingesting Over Four Million Rows Per Second With QuestDB Timeseries Database ... von javier ramirez
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 ramirez19 views
Azure SQL - more or/and less than SQL Server von Rafał Hryniewski
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
Rafał Hryniewski259 views
DrupalCampLA 2011: Drupal backend-performance von Ashok Modi
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
Ashok Modi3.8K views
Cómo se diseña una base de datos que pueda ingerir más de cuatro millones de ... von javier ramirez
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 ramirez43 views
Experiences using CouchDB inside Microsoft's Azure team von Brian Benz
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
Brian Benz5.6K views
Redis Everywhere - Sunshine PHP von Ricard Clau
Redis Everywhere - Sunshine PHPRedis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHP
Ricard Clau22.5K views
Planning For High Performance Web Application von Yue Tian
Planning For High Performance Web ApplicationPlanning For High Performance Web Application
Planning For High Performance Web Application
Yue Tian1.3K views
Quick-and-Easy Deployment of a Ceph Storage Cluster von Patrick Quairoli
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
Patrick Quairoli826 views
Redis everywhere - PHP London von Ricard Clau
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
Ricard Clau28K views
Build an Open Source Data Lake For Data Scientists von Shawn Zhu
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
Shawn Zhu335 views

Último

Sprint 226 von
Sprint 226Sprint 226
Sprint 226ManageIQ
8 views18 Folien
HarshithAkkapelli_Presentation.pdf von
HarshithAkkapelli_Presentation.pdfHarshithAkkapelli_Presentation.pdf
HarshithAkkapelli_Presentation.pdfharshithakkapelli
12 views16 Folien
FIMA 2023 Neo4j & FS - Entity Resolution.pptx von
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptxNeo4j
12 views26 Folien
JioEngage_Presentation.pptx von
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptxadmin125455
6 views4 Folien
Top-5-production-devconMunich-2023.pptx von
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptxTier1 app
8 views40 Folien
SAP FOR CONTRACT MANUFACTURING.pdf von
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
13 views2 Folien

Último(20)

FIMA 2023 Neo4j & FS - Entity Resolution.pptx von Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j12 views
JioEngage_Presentation.pptx von admin125455
JioEngage_Presentation.pptxJioEngage_Presentation.pptx
JioEngage_Presentation.pptx
admin1254556 views
Top-5-production-devconMunich-2023.pptx von Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app8 views
Ports-and-Adapters Architecture for Embedded HMI von Burkhard Stubert
Ports-and-Adapters Architecture for Embedded HMIPorts-and-Adapters Architecture for Embedded HMI
Ports-and-Adapters Architecture for Embedded HMI
Burkhard Stubert21 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx von animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 views
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports von Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... von Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
tecnologia18.docx von nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views
Navigating container technology for enhanced security by Niklas Saari von Metosin Oy
Navigating container technology for enhanced security by Niklas SaariNavigating container technology for enhanced security by Niklas Saari
Navigating container technology for enhanced security by Niklas Saari
Metosin Oy14 views
Dapr Unleashed: Accelerating Microservice Development von Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski12 views
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... von Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri890 views
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... von TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin96 views

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