Sus múltiples casos de usos y su excepcional rendimiento hacen que Redis sea hoy una pieza clave en la arquitectura de aplicaciones altamente dinámicas.
En la charla se expone de forma práctica cómo puede integrarse Redis en una aplicación Symfoy y cómo pueden implementarse varias de las características de las aplicaciones usando Redis, como por ejemplo: Session storage, Monolog logging handlers, Doctrine caching, SwiftMailer spooling, Profiler storage, Data Collector for Symfony2 Profiler.
Además de estos casos de uso generales, se comentan otros casos de usos específicos de aplicaciones que por su naturaleza no pueden beneficiarse de una capa de cache y se requiere por tanto una herramienta eficiente y escalable para resolver ciertos tipos de problemas.
Speed up your Symfony2 application and build awesome features with RedisRicard Clau
Redis is an extremely fast data structure server that can be easily added to your existing stack and act like a Swiss army knife to help solve many problems that would be extremely difficult to workaround with the traditional RDBMS. In this session we will focus on what Redis is, how it works, what awesome features we can build with it and how we can use it with PHP and integrate it with Symfony2 applications making them blazing fast.
DAOS is a open-source storage-as-a-service stack designed from the ground up to address many of the problems that arise when scaling out storage. DAOS takes advantage of next generation non-volatile memory technologies while presenting a rich and scalable storage interface providing features such as transactional non-blocking list I/O, data resiliency on top of commodity hardware, fine grained data control, and storage tiering to optimize performance and cost.
Processing Large Datasets for ADAS Applications using Apache SparkDatabricks
Semantic segmentation is the classification of every pixel in an image/video. The segmentation partitions a digital image into multiple objects to simplify/change the representation of the image into something that is more meaningful and easier to analyze [1][2]. The technique has a wide variety of applications ranging from perception in autonomous driving scenarios to cancer cell segmentation for medical diagnosis.
Exponential growth in the datasets that require such segmentation is driven by improvements in the accuracy and quality of the sensors generating the data extending to 3D point cloud data. This growth is further compounded by exponential advances in cloud technologies enabling the storage and compute available for such applications. The need for semantically segmented datasets is a key requirement to improve the accuracy of inference engines that are built upon them.
Streamlining the accuracy and efficiency of these systems directly affects the value of the business outcome for organizations that are developing such functionalities as a part of their AI strategy.
This presentation details workflows for labeling, preprocessing, modeling, and evaluating performance/accuracy. Scientists and engineers leverage domain-specific features/tools that support the entire workflow from labeling the ground truth, handling data from a wide variety of sources/formats, developing models and finally deploying these models. Users can scale their deployments optimally on GPU-based cloud infrastructure to build accelerated training and inference pipelines while working with big datasets. These environments are optimized for engineers to develop such functionality with ease and then scale against large datasets with Spark-based clusters on the cloud.
PostgreSQL is a powerful, enterprise class open source object-relational database system with an emphasis on extensibility and standards-compliance. PostgreSQL boasts many sophisticated features and runs stored procedures in more than a dozen programming languages. We’ll explore the advantages and limitations of PostgreSQL, examples of where it is best suited for use, and examples of who is using PostgreSQL to power their applications.
In the last two years, Netflix has seen a mass migration to Spark from Pig and other MR engines. This talk will focus on the challenges of that migration and the work that has made it possible. This will include contributions that Netflix has made to Spark to enable wider adoption and on-going projects to make Spark appeal to a broader range of analysts, beyond data and ML engineers.
Speaker Ryan Blue
Speed up your Symfony2 application and build awesome features with RedisRicard Clau
Redis is an extremely fast data structure server that can be easily added to your existing stack and act like a Swiss army knife to help solve many problems that would be extremely difficult to workaround with the traditional RDBMS. In this session we will focus on what Redis is, how it works, what awesome features we can build with it and how we can use it with PHP and integrate it with Symfony2 applications making them blazing fast.
DAOS is a open-source storage-as-a-service stack designed from the ground up to address many of the problems that arise when scaling out storage. DAOS takes advantage of next generation non-volatile memory technologies while presenting a rich and scalable storage interface providing features such as transactional non-blocking list I/O, data resiliency on top of commodity hardware, fine grained data control, and storage tiering to optimize performance and cost.
Processing Large Datasets for ADAS Applications using Apache SparkDatabricks
Semantic segmentation is the classification of every pixel in an image/video. The segmentation partitions a digital image into multiple objects to simplify/change the representation of the image into something that is more meaningful and easier to analyze [1][2]. The technique has a wide variety of applications ranging from perception in autonomous driving scenarios to cancer cell segmentation for medical diagnosis.
Exponential growth in the datasets that require such segmentation is driven by improvements in the accuracy and quality of the sensors generating the data extending to 3D point cloud data. This growth is further compounded by exponential advances in cloud technologies enabling the storage and compute available for such applications. The need for semantically segmented datasets is a key requirement to improve the accuracy of inference engines that are built upon them.
Streamlining the accuracy and efficiency of these systems directly affects the value of the business outcome for organizations that are developing such functionalities as a part of their AI strategy.
This presentation details workflows for labeling, preprocessing, modeling, and evaluating performance/accuracy. Scientists and engineers leverage domain-specific features/tools that support the entire workflow from labeling the ground truth, handling data from a wide variety of sources/formats, developing models and finally deploying these models. Users can scale their deployments optimally on GPU-based cloud infrastructure to build accelerated training and inference pipelines while working with big datasets. These environments are optimized for engineers to develop such functionality with ease and then scale against large datasets with Spark-based clusters on the cloud.
PostgreSQL is a powerful, enterprise class open source object-relational database system with an emphasis on extensibility and standards-compliance. PostgreSQL boasts many sophisticated features and runs stored procedures in more than a dozen programming languages. We’ll explore the advantages and limitations of PostgreSQL, examples of where it is best suited for use, and examples of who is using PostgreSQL to power their applications.
In the last two years, Netflix has seen a mass migration to Spark from Pig and other MR engines. This talk will focus on the challenges of that migration and the work that has made it possible. This will include contributions that Netflix has made to Spark to enable wider adoption and on-going projects to make Spark appeal to a broader range of analysts, beyond data and ML engineers.
Speaker Ryan Blue
O termo NewSQL inclui bancos de dados que prometem a escalabilidade dos NoSQL e transações ACID e linguagem SQL dos bancos de dados tradicionais. O VoltDB, desenvolvido pela equipe de Michael Stonebraker, é o principal exemplo dessa vertente. Essa palestra apresenta a experiência de uso do VoltDB, descreve benefícios de desafios do seu uso, e compara essa solução com outras ferramentas como o Apache Ignite.
How to boost your datamanagement with Dremio ?Vincent Terrasi
Works with any source. Relational, non-relational, 3rd party apps. 5 years ago nobody was using Hadoop, MongoDB, and 5 years from now there will be new products. You need a solution that is future proof.
Works with any BI tool. In every company multiple tools are in use. Each department has their favorite. We need to work with all of them.
No ETL, data warehouse, cubes. This would need to give you a really good alternative to these options.
Makes data self-service, collaborative. Probably most important of all, we need to change the dynamic between the business and IT. We need to make it so business users can get the data they want, in the shape they want it, without waiting on IT.
Makes Big Data feels small. It needs to make billions of rows feel like a spreadsheet on your desktop.
Open source. It’s 2017, so we think this has to be open source.
Aaron Mildenstein - Using Logstash with ZabbixZabbix
Logstash is a terrific tool for capturing, filtering, parsing and enriching data from a number of sources—including logs, of course. But Logstash is also able to capture from many other sources, including social media streams, databases, and many more. Data streams like these are a potential gold mine for Zabbix trending and alerting of all kinds.
In this talk Aaron Mildensten will provide an overview of how to configure and integrate Logstash with Zabbix to:
* capture data
* parse data events into key/value pairs
* associate an event with the time-stamp provided by the data
* generate metrics from the data
* output these values to Zabbix, with the associated time-stamp
Zabbix Conference 2015
Un "Active Directory" (Directorio Activo) es un servicio de directorio desarrollado por Microsoft que se utiliza en entornos de red basados en Windows. Proporciona una estructura jerárquica y centralizada para administrar, organizar y controlar los recursos de red, como usuarios, grupos, equipos, impresoras y otros objetos de red.
El Active Directory es utilizado principalmente en entornos empresariales para facilitar la administración y el control de los recursos de red. Algunas de las funciones clave que ofrece son:
Autenticación y autorización: Permite a los usuarios iniciar sesión en los sistemas y acceder a los recursos de la red de acuerdo con sus permisos y roles definidos.
Gestión de usuarios y grupos: Facilita la creación, modificación y eliminación de cuentas de usuario, así como la asignación de usuarios a grupos para una gestión más eficiente de los permisos y políticas de seguridad.
Administración de políticas de grupo: Permite definir y aplicar políticas de seguridad y configuración a grupos de usuarios o equipos, lo que simplifica la gestión y el mantenimiento de la infraestructura de red.
Administración centralizada de recursos: Proporciona una ubicación central para administrar y organizar objetos de red, como equipos, impresoras y servidores, lo que facilita la administración y el acceso a los recursos.
Replicación de datos: Permite la replicación de datos del Directorio Activo en varios controladores de dominio, lo que mejora la disponibilidad y la tolerancia a fallos.
Búsqueda y consulta de objetos: Permite buscar y consultar objetos de forma eficiente en el Directorio Activo utilizando consultas basadas en atributos específicos.
Integración con otros servicios: El Active Directory se integra con otros servicios de Windows, como el DNS (Domain Name System), lo que permite una gestión y resolución de nombres más eficiente en la red.
by Mahesh Pakal, AWS
PostgreSQL is a powerful, enterprise class open source object-relational database system with an emphasis on extensibility and standards-compliance. PostgreSQL boasts many sophisticated features and runs stored procedures in more than a dozen programming languages. We’ll explore the advantages and limitations of PostgreSQL, examples of where it is best suited for use, and examples of who is using PostgreSQL to power their applications.
This is a introduction to PostgreSQL that provides a brief overview of PostgreSQL's architecture, features and ecosystem. It was delivered at NYLUG on Nov 24, 2014.
http://www.meetup.com/nylug-meetings/events/180533472/
Building Robust ETL Pipelines with Apache SparkDatabricks
Stable and robust ETL pipelines are a critical component of the data infrastructure of modern enterprises. ETL pipelines ingest data from a variety of sources and must handle incorrect, incomplete or inconsistent records and produce curated, consistent data for consumption by downstream applications. In this talk, we’ll take a deep dive into the technical details of how Apache Spark “reads” data and discuss how Spark 2.2’s flexible APIs; support for a wide variety of datasources; state of art Tungsten execution engine; and the ability to provide diagnostic feedback to users, making it a robust framework for building end-to-end ETL pipelines.
Breaking the cyber kill chain! This slide was presented in securITy – information security conference digital world 2017. This talk is about proactive security and threat hunting.
Introduction to the DAOS Scale-out object store (HLRS Workshop, April 2017)Johann Lombardi
DAOS is a open-source storage stack designed from the ground up to address many of the problems that arise when scaling out storage. DAOS takes advantage of next generation non-volatile memory technologies while presenting a rich and scalable storage interface providing features such as transactional non-blocking list I/O, data resiliency on top of commodity hardware, fine grained data control, and storage tiering to optimize performance and cost. Check out https://github.com/daos-stack for more information.
Eventually, every website fails. If it's a household-name site like Amazon, then news of that failure gets around faster than a rocket full of monkeys. That's because downtime hurts. As a for-instance, in 2013 Amazon suffered a 40-minute outage that allegedly cost the company $5 million in lost sales. That's a big number, and everybody loves big numbers.
But when it comes to performance-related losses, is it the biggest number?
In this presentation from the CMG Performance and Capacity 2014 conference, Radware Web Performance Expert Tammy Everts reviews real-world examples that compare the cost of site slowdowns versus outages. We also talk about how to overcome the challenges of creating as much urgency around the topic of slow time as there is around the topic of downtime.
From Zero to Hero - Centralized Logging with Logstash & ElasticsearchSematext Group, Inc.
Originally presented at DevOpsDays Warsaw 2014. How to set up centralized logging either using ELK stack - Logstash, Elasticsearch, and Kibana or using Logsene.
O termo NewSQL inclui bancos de dados que prometem a escalabilidade dos NoSQL e transações ACID e linguagem SQL dos bancos de dados tradicionais. O VoltDB, desenvolvido pela equipe de Michael Stonebraker, é o principal exemplo dessa vertente. Essa palestra apresenta a experiência de uso do VoltDB, descreve benefícios de desafios do seu uso, e compara essa solução com outras ferramentas como o Apache Ignite.
How to boost your datamanagement with Dremio ?Vincent Terrasi
Works with any source. Relational, non-relational, 3rd party apps. 5 years ago nobody was using Hadoop, MongoDB, and 5 years from now there will be new products. You need a solution that is future proof.
Works with any BI tool. In every company multiple tools are in use. Each department has their favorite. We need to work with all of them.
No ETL, data warehouse, cubes. This would need to give you a really good alternative to these options.
Makes data self-service, collaborative. Probably most important of all, we need to change the dynamic between the business and IT. We need to make it so business users can get the data they want, in the shape they want it, without waiting on IT.
Makes Big Data feels small. It needs to make billions of rows feel like a spreadsheet on your desktop.
Open source. It’s 2017, so we think this has to be open source.
Aaron Mildenstein - Using Logstash with ZabbixZabbix
Logstash is a terrific tool for capturing, filtering, parsing and enriching data from a number of sources—including logs, of course. But Logstash is also able to capture from many other sources, including social media streams, databases, and many more. Data streams like these are a potential gold mine for Zabbix trending and alerting of all kinds.
In this talk Aaron Mildensten will provide an overview of how to configure and integrate Logstash with Zabbix to:
* capture data
* parse data events into key/value pairs
* associate an event with the time-stamp provided by the data
* generate metrics from the data
* output these values to Zabbix, with the associated time-stamp
Zabbix Conference 2015
Un "Active Directory" (Directorio Activo) es un servicio de directorio desarrollado por Microsoft que se utiliza en entornos de red basados en Windows. Proporciona una estructura jerárquica y centralizada para administrar, organizar y controlar los recursos de red, como usuarios, grupos, equipos, impresoras y otros objetos de red.
El Active Directory es utilizado principalmente en entornos empresariales para facilitar la administración y el control de los recursos de red. Algunas de las funciones clave que ofrece son:
Autenticación y autorización: Permite a los usuarios iniciar sesión en los sistemas y acceder a los recursos de la red de acuerdo con sus permisos y roles definidos.
Gestión de usuarios y grupos: Facilita la creación, modificación y eliminación de cuentas de usuario, así como la asignación de usuarios a grupos para una gestión más eficiente de los permisos y políticas de seguridad.
Administración de políticas de grupo: Permite definir y aplicar políticas de seguridad y configuración a grupos de usuarios o equipos, lo que simplifica la gestión y el mantenimiento de la infraestructura de red.
Administración centralizada de recursos: Proporciona una ubicación central para administrar y organizar objetos de red, como equipos, impresoras y servidores, lo que facilita la administración y el acceso a los recursos.
Replicación de datos: Permite la replicación de datos del Directorio Activo en varios controladores de dominio, lo que mejora la disponibilidad y la tolerancia a fallos.
Búsqueda y consulta de objetos: Permite buscar y consultar objetos de forma eficiente en el Directorio Activo utilizando consultas basadas en atributos específicos.
Integración con otros servicios: El Active Directory se integra con otros servicios de Windows, como el DNS (Domain Name System), lo que permite una gestión y resolución de nombres más eficiente en la red.
by Mahesh Pakal, AWS
PostgreSQL is a powerful, enterprise class open source object-relational database system with an emphasis on extensibility and standards-compliance. PostgreSQL boasts many sophisticated features and runs stored procedures in more than a dozen programming languages. We’ll explore the advantages and limitations of PostgreSQL, examples of where it is best suited for use, and examples of who is using PostgreSQL to power their applications.
This is a introduction to PostgreSQL that provides a brief overview of PostgreSQL's architecture, features and ecosystem. It was delivered at NYLUG on Nov 24, 2014.
http://www.meetup.com/nylug-meetings/events/180533472/
Building Robust ETL Pipelines with Apache SparkDatabricks
Stable and robust ETL pipelines are a critical component of the data infrastructure of modern enterprises. ETL pipelines ingest data from a variety of sources and must handle incorrect, incomplete or inconsistent records and produce curated, consistent data for consumption by downstream applications. In this talk, we’ll take a deep dive into the technical details of how Apache Spark “reads” data and discuss how Spark 2.2’s flexible APIs; support for a wide variety of datasources; state of art Tungsten execution engine; and the ability to provide diagnostic feedback to users, making it a robust framework for building end-to-end ETL pipelines.
Breaking the cyber kill chain! This slide was presented in securITy – information security conference digital world 2017. This talk is about proactive security and threat hunting.
Introduction to the DAOS Scale-out object store (HLRS Workshop, April 2017)Johann Lombardi
DAOS is a open-source storage stack designed from the ground up to address many of the problems that arise when scaling out storage. DAOS takes advantage of next generation non-volatile memory technologies while presenting a rich and scalable storage interface providing features such as transactional non-blocking list I/O, data resiliency on top of commodity hardware, fine grained data control, and storage tiering to optimize performance and cost. Check out https://github.com/daos-stack for more information.
Eventually, every website fails. If it's a household-name site like Amazon, then news of that failure gets around faster than a rocket full of monkeys. That's because downtime hurts. As a for-instance, in 2013 Amazon suffered a 40-minute outage that allegedly cost the company $5 million in lost sales. That's a big number, and everybody loves big numbers.
But when it comes to performance-related losses, is it the biggest number?
In this presentation from the CMG Performance and Capacity 2014 conference, Radware Web Performance Expert Tammy Everts reviews real-world examples that compare the cost of site slowdowns versus outages. We also talk about how to overcome the challenges of creating as much urgency around the topic of slow time as there is around the topic of downtime.
From Zero to Hero - Centralized Logging with Logstash & ElasticsearchSematext Group, Inc.
Originally presented at DevOpsDays Warsaw 2014. How to set up centralized logging either using ELK stack - Logstash, Elasticsearch, and Kibana or using Logsene.
The slides from my talk at PHPUK2015.
The comapniuon code can be found at: https://github.com/LoveSoftware/application-logging-with-logstash
If you saw it, please rate it!
https://joind.in/talk/view/13369
deSymfony 2013 - Creando aplicaciones web desde otro ángulo con Symfony y A...Pablo Godel
AngularJS es un framework Javascript relativamente nuevo, patrocinado por Google, que está ganando mucha popularidad gracias a su potencia, flexibilidad y simplicidad.
En esta charla haremos una introducción de sus caulidades más importantes, veremos como se acopla con Symfony para la creación de aplicaciones web con interfaz ricas y complejas, incluyendo consejos prácticos de como diseñar nuestra aplicación establecer su estructura.
Por último, mostraremos una aplicación escrita en AngularJS que se conecta a servidores REST y WebSockets creados con Symfony.
Gánale la partida a tu SQL Server, configuración ideal para que todo vaya bie...SolidQ
Aunque SQL Server funciona bastante bien "por defecto" realmente una buena configuración puede marcar la diferencia durante un pico de carga o comprometer la estabilidad del sistema. Aprendemos cómo configurar correctamente nuestra instancia SQL Server para mejorar el rendimiento y evitar inestabilidades en su funcionamiento.
Redis: servidor de estructuras de datosAntonio Ognio
Una introducción a Redis, un servidor de estructuras de datos en red que actua como una base de datos no-relacional con almacenamiento principal en memoria RAM y estrategias de almacenamiento persistente basadas en disco.
Índice del libro "Big Data: Tecnologías para arquitecturas Data-Centric" de 0...Telefónica
Índice del libro "Big Data: Tecnologías para arquitecturas Data-Centric" de 0xWord escrito por Ibón Reinoso ( https://mypublicinbox.com/IBhone ) con Prólogo de Chema Alonso ( https://mypublicinbox.com/ChemaAlonso ). Puedes comprarlo aquí: https://0xword.com/es/libros/233-big-data-tecnologias-para-arquitecturas-data-centric.html
3Redu: Responsabilidad, Resiliencia y Respetocdraco
¡Hola! Somos 3Redu, conformados por Juan Camilo y Cristian. Entendemos las dificultades que enfrentan muchos estudiantes al tratar de comprender conceptos matemáticos. Nuestro objetivo es brindar una solución inclusiva y accesible para todos.
Las lámparas de alta intensidad de descarga o lámparas de descarga de alta in...espinozaernesto427
Las lámparas de alta intensidad de descarga o lámparas de descarga de alta intensidad son un tipo de lámpara eléctrica de descarga de gas que produce luz por medio de un arco eléctrico entre electrodos de tungsteno alojados dentro de un tubo de alúmina o cuarzo moldeado translúcido o transparente.
lámparas más eficientes del mercado, debido a su menor consumo y por la cantidad de luz que emiten. Adquieren una vida útil de hasta 50.000 horas y no generan calor alguna. Si quieres cambiar la iluminación de tu hogar para hacerla mucho más eficiente, ¡esta es tu mejor opción!
Las nuevas lámparas de descarga de alta intensidad producen más luz visible por unidad de energía eléctrica consumida que las lámparas fluorescentes e incandescentes, ya que una mayor proporción de su radiación es luz visible, en contraste con la infrarroja. Sin embargo, la salida de lúmenes de la iluminación HID puede deteriorarse hasta en un 70% durante 10,000 horas de funcionamiento.
Muchos vehículos modernos usan bombillas HID para los principales sistemas de iluminación, aunque algunas aplicaciones ahora están pasando de bombillas HID a tecnología LED y láser.1 Modelos de lámparas van desde las típicas lámparas de 35 a 100 W de los autos, a las de más de 15 kW que se utilizan en los proyectores de cines IMAX.
Esta tecnología HID no es nueva y fue demostrada por primera vez por Francis Hauksbee en 1705. Lámpara de Nernst.
Lámpara incandescente.
Lámpara de descarga. Lámpara fluorescente. Lámpara fluorescente compacta. Lámpara de haluro metálico. Lámpara de vapor de sodio. Lámpara de vapor de mercurio. Lámpara de neón. Lámpara de deuterio. Lámpara xenón.
Lámpara LED.
Lámpara de plasma.
Flash (fotografía) Las lámparas de descarga de alta intensidad (HID) son un tipo de lámparas de descarga de gas muy utilizadas en la industria de la iluminación. Estas lámparas producen luz creando un arco eléctrico entre dos electrodos a través de un gas ionizado. Las lámparas HID son conocidas por su gran eficacia a la hora de convertir la electricidad en luz y por su larga vida útil.
A diferencia de las luces fluorescentes, que necesitan un recubrimiento de fósforo para emitir luz visible, las lámparas HID no necesitan ningún recubrimiento en el interior de sus tubos. El propio arco eléctrico emite luz visible. Sin embargo, algunas lámparas de halogenuros metálicos y muchas lámparas de vapor de mercurio tienen un recubrimiento de fósforo en el interior de la bombilla para mejorar el espectro luminoso y reproducción cromática. Las lámparas HID están disponibles en varias potencias, que van desde los 25 vatios de las lámparas de halogenuros metálicos autobalastradas y los 35 vatios de las lámparas de vapor de sodio de alta intensidad hasta los 1.000 vatios de las lámparas de vapor de mercurio y vapor de sodio de alta intensidad, e incluso hasta los 1.500 vatios de las lámparas de halogenuros metálicos.
Las lámparas HID requieren un equipo de control especial llamado balasto para funcionar
Inteligencia Artificial y Ciberseguridad.pdfEmilio Casbas
Recopilación de los puntos más interesantes de diversas presentaciones, desde los visionarios conceptos de Alan Turing, pasando por la paradoja de Hans Moravec y la descripcion de Singularidad de Max Tegmark, hasta los innovadores avances de ChatGPT, y de cómo la IA está transformando la seguridad digital y protegiendo nuestras vidas.
En este documento analizamos ciertos conceptos relacionados con la ficha 1 y 2. Y concluimos, dando el porque es importante desarrollar nuestras habilidades de pensamiento.
Sara Sofia Bedoya Montezuma.
9-1.
3. ¿Quién soy?
• Backend Core Tech Lead @ Socialpoint
Arquitectura y desarrollo de aplicaciones que
eficientemente respondan peticiones de millones de
usuarios cada día
• Redis Fan
• Made in Cuba
• Poco original eligiendo memes
• @ronnylt
Monday, June 24, 13
18. Ideal para
• Analíticas real-time
• Tracking
• Caching server (memcached on steroid)
• Colas de trabajo
• Escritura/Lectura intensiva (sesiones)
Monday, June 24, 13
20. Claves y valores
• Los datos (values) son refereciados a través
de claves (keys)
• Los datos pueden ser recuperados solo si
conocemos el nombre de la clave
Monday, June 24, 13
21. Claves
(keys)
• Únicas dentro de la BD
• Binary safe string
• Claves muy grandes pueden impactar en el
rendimimiento
• Claves muy pequeñas no aportan mucho
(u:123:n vs user:123:name)
Monday, June 24, 13
22. No es un RMDBS
• No hay consultas (queries)
• No hay índices
• No hay esquemas
Monday, June 24, 13
24. Comandos
• Lenguaje de comandos fácil de usar y de
aprender
• Los comandos (en su mayoría) son aplicables
a un tipo de datos específico
Monday, June 24, 13
26. Cadenas
• Tipo de dato simple (cualquier cadena binary-safe)
• Tamaño máximo de 512 MB
key string
GET, SET, STRLEN,APPEND, GETRANGE, SETRANGE
http://redis.io/commands#string
Monday, June 24, 13
27. Casos de uso cadenas
• Almacenamiento de cualquier dato (serializado):
GET, SET
• Vector de acceso aleatorio con GETRANGE,
SETRANGE
• Mapa de bits usando GETBIT, SETBIT,
BITCOUNT
Monday, June 24, 13
28. Casos de uso cadenas
• Contadores atómicos con:
INCR, DECR
INCRBY, DECRBY
INCRFLOATBY
INCR dowloads:item:123
=> 450
INCR dowloads:item:123
=> 451
Monday, June 24, 13
29. Listas
• Listado de cadenas donde el orden es importante
• Operaciones de inserción por la izquierda y por
la derecha o por posición
• Máxima longitud de 2^32 -1 (+4 billones)
key s2s1 s3...
http://redis.io/commands#list
Monday, June 24, 13
30. Casos de uso Listas
• Representación de colas (insertando por la
derecha, leyendo por la izquierda) RPUSH, LPOP
• Representación de pilas (insertando y leyendo por
la izquierda) LPUSH, LPOP
• Comandos blocking BLPOP, BRPOP, BRPOPLPUSH
Monday, June 24, 13
31. Conjuntos
• Colección de elementos únicos donde el
orden no importa
• Operaciones típicas de conjuntos sobre los
datos
key
blue
green
red
black
Monday, June 24, 13
33. Casos de uso
Conjuntos
• Representación de relaciones
• Tracking de sucesos únicos
• Cualquier problema donde por su naturaleza se
realicen operaciones sobre conjuntos
Monday, June 24, 13
34. Conjuntos Ordenados
• Conjuntos de datos, pero ordenados por
un score
• Elementos únicos dentro del conjunto, cada
uno con un score asignado
key
blue – 520
green – 890
red – 303
black – 680
Monday, June 24, 13
35. Conjuntos Ordenados
• Operaciones de conjuntos aplicables
• Operaciones de acceso por score y por rango en
tiempo constante y predecible
http://redis.io/commands#sorted_set
Monday, June 24, 13
36. Casos de uso
Conjuntos Ordenados
• Leaderboards
• Rankings
• Tracking basado en tiempo
Monday, June 24, 13
37. Hashes
• Múltiples campo => valor en una misma clave
• Hasta un máximo de 2^32 -1 pares campo => valor
key field1 value1
field2 value2
field3 value3
http://redis.io/commands#hash
Monday, June 24, 13
38. Hashes
• Puede verse como un arreglo asociativo en PHP:
clave => [
campo1 => valor1,
campo2 => valor2,
campo3 => valor3
]
• Operaciones sobre campos individuales
Monday, June 24, 13
39. Casos de uso Hashes
• Almacenamiento de objetos compuestos
por varios campos
• Mappings
Monday, June 24, 13
40. Resumiendo...
• Tenemos la oportunidad de usar la estructura
de datos adecuada para cada tipo de problema
• Tendremos tiempos de ejecución constantes y
predecibles, sin importar el tamaño de los
conjuntos de datos (dataset)
Monday, June 24, 13
42. Clientes para PHP
• https://github.com/nrk/predis
• https://github.com/nicolasff/phpredis
Clientes disponibles para la mayoría de los lenguajes de
programación (http://redis.io/clients)
Monday, June 24, 13
43. Predis
"require": {
"predis/predis": "~0.8.3"
},
• Escrito en PHP
• Maduro y activamente mantenido
• Extensible
• Feature-complete (pipelines, client side sharding,
server profiles, master/slave config, etc.)
Monday, June 24, 13
44. phpredis
• Escrito en C como una extensión PHP
• Listo para producción
• Extremadamente rápido
• No backward compatible con anteriores
versions de Redis
Monday, June 24, 13
45. ¿Cuál usar?
• Depende...
• Predis cubre la mayoría de las necesidades,
fácil de instalar con composer, y nos ofrece
un rendimiento aceptable
• phpredis si necesitas un rendimiento
excepcional
Monday, June 24, 13
46. La latencia de red sigue
siendo el principal
“performance killer”,
no el cliente
Monday, June 24, 13
53. Obteniendo el cliente a
través del container
$redis = $container->get('snc_redis.default');
$key = 'downloads:' . $pid . ':count'
$downloads = $redis->incr($key);
php app/console container:debug | grep snc_redis
Monday, June 24, 13
54. Clientes registrados
como servicios
php app/console container:debug
snc_redis.default
Information for service snc_redis.default
Service Id snc_redis.default
Class PredisClient
Tags -
Scope container
Public yes
Synthetic no
Required File -
Monday, June 24, 13
55. Inyectando Redis como
dependencia
namespace AcmeDemoBundleService;
use SncRedisBundleClientPredis as Redis;
class DownloadCounter
{
protected $redis;
public function __construct(Redis $redis)
{
$this->redis = $redis;
}
public function count($itemId)
{
return $this->redis->incr('downloads:' . $itemId . ':count');
}
}
Monday, June 24, 13
56. Inyectando Redis como
dependencia
<service id="acme.demo.download_counter"
class="AcmeDemoBundleServiceDownloadCounter">
...
<argument type="service" id="snc_redis.default" />
...
</service>
Monday, June 24, 13
58. Sesiones
• Difícil de escalar con la configuración por
defecto
• Por naturaleza no cacheable (read-change-
write back)
• Se necesita mantener estado consistente
Monday, June 24, 13
63. Sesiones en Redis
• Sesiones distribuídas (ej. detrás de un
balanceador sin sticky sessions)
• Excepcional rendimiento de escritura/lectura
• Tiempo de acceso constante y predecible
• Escalable horizontalmente (client-side sharding)
Monday, June 24, 13
64. Session handlers
• A través de un session handler implementado
en PHP, conectando a través de un cliente
Redis
• A través de un session handler implementado
en una extensión de PHP (phpredis)
Monday, June 24, 13
66. Usando phpredis
framework:
session:
# Default storage service
storage_id: "session.storage.native"
# No handler service, use default
handler_id: ~
# The name for the session cookie
name: "appsesid"
config.yml
Monday, June 24, 13
70. Monolog logging
• Los mensajes de logs son almacenados en
una lista
• Ideal cuando se necesita un broker que
reciba los logs que serán posteriormente
enviados a un agregador (ej. logstash)
Monday, June 24, 13
74. SwiftMailer Spooling
• Los mensajes no se envian directamente, sino que
se mantienen en un “spool” y son enviados por un
proceso en background
• Usando redis como “spool”, los mensajes son
mantenidos en una lista hasta que son enviados
Monday, June 24, 13
79. Desventajas
• Difícil de cambiar la configuración de routing
una vez creadas
• Es requerido tener copia de la base de datos
de routings en los ambientes de desarrollo
para que la aplicación funcione
Monday, June 24, 13
80. Solución alternativa
• Crear un mapping entre rutas amigables y
rutas internas
• Subscribirse a KernelEvents::REQUEST y
antes que nada, cambiar pathInfo en el objeto
Request
Monday, June 24, 13
88. ¿Quién está online?
• Mantenemos un conjunto con los usuarios
que han estado online por cada minuto
• En cada request, agregamos al usuario al
conjunto de usuarios online del minuto
actual
• Obtenemos los usuarios que han estado
online de la unión de los 5 últimos
conjuntos
Monday, June 24, 13
90. Amigos online
• Mantenemos un conjunto con los amigos
de cada usuario
• Obtenemos los amigos que están online, de
la intersección del conjunto de usuarios
online con el conjunto de amigos de un
usuario
Monday, June 24, 13
92. class OnlineUsersManager
{
protected $redis;
public function __construct(Redis $redis)
{
$this->redis = $redis;
}
public function trackUser($userId)
{
$timestamp = time();
$minute = date('i', $timestamp);
$key = 'online_users:' . $minute;
// Add the user to the set of online users in the
current minute.
$this->redis->sadd($key, $userId);
// Expire in 10 minutes.
$this->redis->expire(60 * 10);
}Monday, June 24, 13
93. Leaderboards
• Caso de uso típico el cual es fácil de implementar
con Redis y díficil de implementar de forma
eficiente en otro sistema
• Los conjuntos ordenados son las estructuras de
datos perfectas para su implementación
Monday, June 24, 13
95. class RankingManager
{
protected $redis;
public function __construct(Redis $redis)
{
$this->redis = $redis;
}
public function onCombatFinished(Combat $combat)
{
$winner = $combat->getAttacker();
$score = $combat->getScoreResult();
$this->redis->zincr('ranking', $score, $winner->getId());
}
public function getTopScores($limit)
{
return $this->redis->zrevrange('ranking', 0, $limit);
}
}
Monday, June 24, 13
96. Extra Tips
• Redis es single-threaded, todos los
comandos son atómicos
• Transacciones pueden usarse para ejecutar
múltiples comandos de forma atómica
• Lua scripts se ejecutan de forma atómica
también
•
Monday, June 24, 13
97. Performance Tips
• Usando client-side sharding puede escalarse
horizontalmente ganando en capacidad y
rendimiento
• Ejecutar múltiples comandos a través de
pipelines
Monday, June 24, 13
99. NO usar Redis
• Cuando el conjunto de datos (dataset) no
cabe en memoria
• Datos de naturaleza relacional
• Cuando no se conoce de antemano como
van a consultarse los datos
Monday, June 24, 13
100. Cuándo usar Redis
• Redis para datos temporales, altamente dinámicos
y estructuras de datos complejas
• Datos de naturaleza no-relacional
• Ideal para aplicaciones que son write-heavy
• Datos que naturalmente se ajustan a una
estructura de Redis
Monday, June 24, 13
101. Inegrando Redis en un
stack PHP/Symfony2
• No necesariamente como la DB principal
• Resolviendo problemas que son difíciles de
resolver en un sistema relacional
• Beneficiandonos de las características de Redis de
forma incremental
• Usando la herramienta adecuada para cada tarea
Monday, June 24, 13