Using Redis as a Cache Backend in MagentoUsing Redis as a ...
Redis
-
Upload
open-university-kmi -
Category
Documents
-
view
505 -
download
0
description
Transcript of Redis
![Page 1: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/1.jpg)
RedisCursillos de verano del e-ghost 2012
Pablo Orduna y Aitor Gomez-Goiri{pablo.orduna,aitor.gomez}@deusto.es
18 y 19 de Julio de 2012
![Page 2: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/2.jpg)
Outline
Introduccion
Instalacion
Ejercicios
Redis 2 / 37
![Page 3: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/3.jpg)
Outline
Introduccion
Instalacion
Ejercicios
Redis 2 / 37
![Page 4: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/4.jpg)
Outline
Introduccion
Instalacion
Ejercicios
Redis 2 / 37
![Page 5: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/5.jpg)
Outline
Introduccion
Instalacion
Ejercicios
Redis Introduccion 3 / 37
![Page 6: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/6.jpg)
¿Que es Redis?
Remote dictionary server
Redis Introduccion 4 / 37
![Page 7: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/7.jpg)
![Page 8: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/8.jpg)
¿Que es Redis?
...mixed soul of cache,
store, and messagingserver...
Salvatore Sanfilippo
(data structure server, advanced key-value store, etc.)
Redis Introduccion 6 / 37
![Page 9: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/9.jpg)
¿Que es Redis?
...mixed soul of cache, store,
and messagingserver...
Salvatore Sanfilippo
(data structure server, advanced key-value store, etc.)
Redis Introduccion 6 / 37
![Page 10: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/10.jpg)
¿Que es Redis?
...mixed soul of cache, store, and messagingserver...
Salvatore Sanfilippo
(data structure server, advanced key-value store, etc.)
Redis Introduccion 6 / 37
![Page 11: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/11.jpg)
¿Que es Redis?
...mixed soul of cache, store, and messagingserver...
Salvatore Sanfilippo
(data structure server, advanced key-value store, etc.)
Redis Introduccion 6 / 37
![Page 12: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/12.jpg)
Caracterısticas
Redis Introduccion 7 / 37
![Page 13: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/13.jpg)
Caracterısticas
Redis Introduccion 8 / 37
![Page 14: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/14.jpg)
Caracterısticas
Redis Introduccion 9 / 37
![Page 15: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/15.jpg)
Caracterısticas
Redis Introduccion 10 / 37
![Page 16: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/16.jpg)
Caracterısticas
Redis Introduccion 11 / 37
![Page 17: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/17.jpg)
Caracterısticas
Redis Introduccion 12 / 37
![Page 18: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/18.jpg)
Caracterısticas
Redis Introduccion 13 / 37
![Page 19: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/19.jpg)
Caracterısticas
Redis Introduccion 14 / 37
![Page 22: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/22.jpg)
Velocidad
Redis Introduccion 16 / 37
![Page 23: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/23.jpg)
![Page 24: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/24.jpg)
Velocidad y transacciones
I Con el grafico anterior. . .
Sistema Velocidad Transaccional Concurrente RedMySQL (InnoDB) No Sı Sı SıMySQL (MyISAM) No No Sı SıMySQL (Memory) No No Sı Sısqlite (Memory) Sı Sı No No
sqlite (disco) Sı Sı No Noredis Sı Sı Sı Sı
Redis Introduccion 18 / 37
![Page 25: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/25.jpg)
Velocidad
Redis Introduccion 19 / 37
![Page 26: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/26.jpg)
Ejemplo practico: WebLab-Deusto
I WebLab-Deusto: software de la Universidad de Deusto quegestiona acceso a laboratorios fısicos de la misma.
I Regularmente en clase → hasta 60 usuarios concurrentesI Este ano → varios cientos de usuarios concurrentes
Redis Introduccion 20 / 37
![Page 27: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/27.jpg)
Gestion de colas: MySQL I(1 recurso, 150 estudiantes)
Redis Introduccion 21 / 37
![Page 28: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/28.jpg)
Gestion de colas: redis I(1 recurso, 150 estudiantes)
Redis Introduccion 22 / 37
![Page 29: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/29.jpg)
Gestion de colas: MySQL II(80 recursos, 150 estudiantes)
Redis Introduccion 23 / 37
![Page 30: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/30.jpg)
Gestion de colas: redis II(80 recursos, 150 estudiantes)
Redis Introduccion 24 / 37
![Page 31: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/31.jpg)
Outline
Introduccion
Instalacion
Ejercicios
Redis Instalacion 25 / 37
![Page 32: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/32.jpg)
Instalacion
I apt-get install redis-server python-redisI U otra librerıa para crear clientes en el lenguaje que
prefirais...I (en java Jedis)
Redis Instalacion 26 / 37
![Page 33: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/33.jpg)
Outline
Introduccion
Instalacion
Ejercicios
Redis Ejercicios 27 / 37
![Page 34: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/34.jpg)
![Page 35: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/35.jpg)
Caso general
Aplicacion de chat
Redis Ejercicios 29 / 37
![Page 36: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/36.jpg)
Ejercicio 0: Operaciones basicas
I StringsI Comandos: setex, setnx, incr...I Usos:
I usuarios onlineI contadoresI API rate limitingI ids unicos
Redis Ejercicios 30 / 37
![Page 37: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/37.jpg)
Ejercicio 1: Amigos online
I SetsI Comandos: sadd, smembers, sinter. . .I Usos:
I eleccion aleatoria de noticias, etc.I modelar relaciones (followers, following, etc.)I amigos online
Redis Ejercicios 31 / 37
![Page 38: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/38.jpg)
Ejercicio 2: propiedades de amigos
I HashesI Comandos: hset, hget, hvals. . .I Usos:
I almacenamiento de datos estructurados
Redis Ejercicios 32 / 37
![Page 39: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/39.jpg)
Ejercicio 3: chatear
I Publicacion/subscripcionI Comandos: subscribe, publish. . .I Usos:
I Envıo de mensajes N a M
Redis Ejercicios 33 / 37
![Page 40: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/40.jpg)
Ejercicio 4: gestion del tiempo
I PipelinesI Comandos: multi, exec. . .I Usos:
I Envıo de varios comandos en uno
Redis Ejercicios 34 / 37
![Page 41: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/41.jpg)
Bibliografıa I
Sunil Arora.Redis and python.http://www.slideshare.net/sunilar0ra/
redis-and-python-at-pycon2011, September 2011.
Noah Davis and Luke Melia.Redis in practice wiki.http://www.slideshare.net/noahd1/redis-in-practice,December 2010.
Tim Lossen.Redis, memory as the new disk.http://www.slideshare.net/tim.lossen.de/
redis-memory-as-the-new-disk, April 2010.
Redis Bibliografia 35 / 37
![Page 42: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/42.jpg)
Bibliografıa II
Karl Seguin.The Little Redis Book.January 2012.
Redis Bibliografia 36 / 37
![Page 43: Redis](https://reader033.fdocuments.us/reader033/viewer/2022060111/5562eb52d8b42ab47d8b4fdd/html5/thumbnails/43.jpg)
Todas las imagenes son propiedad de susrespectivos duenos*, el resto del contenido
esta licenciado bajo Creative Commons by-sa 3.0.
* Andreas, srippon, Andrew Fitzsimon, jfmelero, liftarn, shokunin,mcol, djmx1, MongoDB, Riak, Cassandra, Redis, Membase, HBase,neo4j y CouchDB.