SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Redis
Wer benutzt Redis?
Instagram
• Redis powers their main feed, activity
feed, sessions system.
• Redis runs on several Quadruple
Extra-Large Memory instances.
• runs in a master-replica setup. Replicas
constantly save to disk.
Stackoverflow
• Use Redis as a caching layer for the
entire network.
• around 1.300.000 keys in Redis cache.
• peak time we're getting a few hundred
read/writes a second to Redis.
• about 1% cpu usage
• started storing much bigger things in
Redis, like inboxes
Redis
• Schlüssel-Werte Datenstruktur
• In-Memory-Datenbank
• Transaction (optimistic Locking)
• Kein MapReduce
Philosophie
Performance
100.000 Schreiboperation
80.000 Leseoperation
pro Sekunde
Datenstrukturen
• String
• Hashes
• Lists
• Sets
• Sorted Sets
String
SET mykey "Hello"
GET mykey
Hash
HSET myhash field1 "Hello"
HGET myhash field1
Sets
SADD myset "Hello"
SADD myset "World"
SMEMBERS myset
Sorted Sets
ZADD myzset 1 "one"
ZADD myzset 1 "uno"
ZADD myzset 2 "two"
ZRANGE myzset 0 -1 WITHSCORES
Praktikum
Abfrage
Alle Buchungen, bei denen der Flug in
Düsseldorf (DUS) begonnen wird.
modelleriung
java
feingranular
Datenstruktur Schlüssel Wert
Set bookings
00QKXC
00D3N0
String exposed:00QKXC 0
Set passengers:00QKXC
Anna:Becker
Alexander:Becker
Hash Anna:Becker
salutations => MS
firstname => Anna
lastname => Becker
List flights:00QKXC
flight:TG921
flight:TG920
Hash flight:TG921
date => 1373407200
departs => 1373460300
fromAirportAbbr => DUS
Hash service:TG921 Infant
Hash seats:TG921
RAUSS/ARMINMR => 08C
(Non-smoking)
Hash fares:00QKXC
type => ADT
taxes => 57.22
Set segments:00QKXC
1
2
Realisierung
Set<String> allBookingIds = jedis.smembers(BOOKINGS);
String flightId;
for(String bookingId : allBookingIds) {
flightId = jedis.lrange(FLIGHTS + bookingId, 0, 0).get(0);
if(jedis.hget(flightId, FROM_AIRPORT_ABBR).equals(startAirport)){
allBookings.add(getBooking(bookingId));
}
}
modelleriung
java
grobgranular
ticket:00P5LM:eticket:220327240100C1,220327240100C2:exposed:1:flights:DUS->CDG->CDG->DUS
Hash Name
key => flights
flights => {...........}
Datenstruktur
GUI-Client
Realisierung
function getBookingsStartingIn($redis, $airport)
{
echo "----------------------------------------------------------n";
echo "Flüge die in $airport starten:n";
$tickets = $redis->query("*flights:$airport->*");
foreach ($tickets as $ticket){
echo "Flight " . $ticket["id"] . " starts in $airportn";
}
echo "----------------------------------------------------------n";
}
Fazit
• Einfache und schnelle Abfragen sind mit
Redis sehr gut zu realisieren.
• Gute Dokumentation.
• Abfragesprache ist nicht mächtig.
Danke für die
Aufmerksamkeit
Links
• Praktikum (Wiki)
• Installation (Webseite)
• Redis Befehle (API)
• NoSQL Einführung (Buch)
• Seven Databases in Seven Weeks (Buch)

Más contenido relacionado

La actualidad más candente

Luci, ricci and the rac bc
Luci, ricci and the rac bcLuci, ricci and the rac bc
Luci, ricci and the rac bc
fauzg
 
Mysql cluster
Mysql clusterMysql cluster
Mysql cluster
JS Lee
 
Apache Ambari - What's New in 1.2.4
Apache Ambari - What's New in 1.2.4Apache Ambari - What's New in 1.2.4
Apache Ambari - What's New in 1.2.4
Hortonworks
 
Sharding - Seoul 2012
Sharding - Seoul 2012Sharding - Seoul 2012
Sharding - Seoul 2012
MongoDB
 
Sharding
ShardingSharding
Sharding
MongoDB
 

La actualidad más candente (20)

Automated Hadoop Cluster Construction on EC2
Automated Hadoop Cluster Construction on EC2Automated Hadoop Cluster Construction on EC2
Automated Hadoop Cluster Construction on EC2
 
Luci, ricci and the rac bc
Luci, ricci and the rac bcLuci, ricci and the rac bc
Luci, ricci and the rac bc
 
Mysql cluster
Mysql clusterMysql cluster
Mysql cluster
 
新浪微博开放平台Redis实战
新浪微博开放平台Redis实战新浪微博开放平台Redis实战
新浪微博开放平台Redis实战
 
企業・業界情報プラットフォームSPEEDAにおけるElasticsearchの活用
企業・業界情報プラットフォームSPEEDAにおけるElasticsearchの活用企業・業界情報プラットフォームSPEEDAにおけるElasticsearchの活用
企業・業界情報プラットフォームSPEEDAにおけるElasticsearchの活用
 
Redis database
Redis databaseRedis database
Redis database
 
Apache Ambari - What's New in 1.2.4
Apache Ambari - What's New in 1.2.4Apache Ambari - What's New in 1.2.4
Apache Ambari - What's New in 1.2.4
 
深入了解Redis
深入了解Redis深入了解Redis
深入了解Redis
 
Bacula4
Bacula4Bacula4
Bacula4
 
Travis
TravisTravis
Travis
 
Round trip - What changes & what doesn't
Round trip - What changes & what doesn'tRound trip - What changes & what doesn't
Round trip - What changes & what doesn't
 
Setting up repositories: Technical Requirements, Repository Software, Metad...
Setting up repositories:  Technical Requirements,  Repository Software, Metad...Setting up repositories:  Technical Requirements,  Repository Software, Metad...
Setting up repositories: Technical Requirements, Repository Software, Metad...
 
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFSHadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
Hadoop Meetup Jan 2019 - Mounting Remote Stores in HDFS
 
Redis and it's data types
Redis and it's data typesRedis and it's data types
Redis and it's data types
 
Redis 101 Data Structure
Redis 101 Data StructureRedis 101 Data Structure
Redis 101 Data Structure
 
Sharding - Seoul 2012
Sharding - Seoul 2012Sharding - Seoul 2012
Sharding - Seoul 2012
 
Sharding
ShardingSharding
Sharding
 
Sharding
ShardingSharding
Sharding
 
Intro to HTTP and Node.js
Intro to HTTP and Node.jsIntro to HTTP and Node.js
Intro to HTTP and Node.js
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 

Destacado

Trabajo de apoyo sociales
Trabajo de apoyo socialesTrabajo de apoyo sociales
Trabajo de apoyo sociales
davidcorreasj
 
Universidad técnica particular de loja
Universidad técnica particular de lojaUniversidad técnica particular de loja
Universidad técnica particular de loja
danny12morocho
 
REDES INFORMATICOS
REDES INFORMATICOSREDES INFORMATICOS
REDES INFORMATICOS
hoymi
 
Sociedad de la información y el conocimiento
Sociedad de la información y el conocimientoSociedad de la información y el conocimiento
Sociedad de la información y el conocimiento
mariana
 

Destacado (20)

One year in now media
One year in now mediaOne year in now media
One year in now media
 
As Visitas De Estudo Do Curso Efa
As Visitas De Estudo Do Curso EfaAs Visitas De Estudo Do Curso Efa
As Visitas De Estudo Do Curso Efa
 
Trabajo de apoyo sociales
Trabajo de apoyo socialesTrabajo de apoyo sociales
Trabajo de apoyo sociales
 
The chicago bulls
The chicago bullsThe chicago bulls
The chicago bulls
 
Sustentabilidade
SustentabilidadeSustentabilidade
Sustentabilidade
 
Bolsa millonaria bvc 2010
Bolsa millonaria bvc 2010Bolsa millonaria bvc 2010
Bolsa millonaria bvc 2010
 
Mujeres y Pintores famosos
Mujeres y Pintores famososMujeres y Pintores famosos
Mujeres y Pintores famosos
 
Guía para Consultar las Base de Datos - Registro de Inventario
Guía para Consultar las Base de Datos - Registro de InventarioGuía para Consultar las Base de Datos - Registro de Inventario
Guía para Consultar las Base de Datos - Registro de Inventario
 
Proyecto Arservir Ltda
Proyecto Arservir LtdaProyecto Arservir Ltda
Proyecto Arservir Ltda
 
Universidad técnica particular de loja
Universidad técnica particular de lojaUniversidad técnica particular de loja
Universidad técnica particular de loja
 
REDES INFORMATICOS
REDES INFORMATICOSREDES INFORMATICOS
REDES INFORMATICOS
 
Erdrugs
ErdrugsErdrugs
Erdrugs
 
Mobile health milstein
Mobile health milsteinMobile health milstein
Mobile health milstein
 
El largo camino hacia la Administración Electrónica
El largo camino hacia la Administración ElectrónicaEl largo camino hacia la Administración Electrónica
El largo camino hacia la Administración Electrónica
 
Estrategias Tic En Epocas De Crisis
Estrategias Tic En Epocas De CrisisEstrategias Tic En Epocas De Crisis
Estrategias Tic En Epocas De Crisis
 
Topologias
TopologiasTopologias
Topologias
 
Sociedad de la información y el conocimiento
Sociedad de la información y el conocimientoSociedad de la información y el conocimiento
Sociedad de la información y el conocimiento
 
FELIZ AÑO 2012!
FELIZ AÑO 2012!FELIZ AÑO 2012!
FELIZ AÑO 2012!
 
Bodite kreativni- Nastja Mulej
Bodite kreativni- Nastja MulejBodite kreativni- Nastja Mulej
Bodite kreativni- Nastja Mulej
 
Listaequiuposytutor
ListaequiuposytutorListaequiuposytutor
Listaequiuposytutor
 

Similar a Redis

Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
Tim Lossen
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
Ricard Clau
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
Tim Lossen
 
Intro to big data choco devday - 23-01-2014
Intro to big data   choco devday - 23-01-2014Intro to big data   choco devday - 23-01-2014
Intro to big data choco devday - 23-01-2014
Hassan Islamov
 
Redis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHPRedis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHP
Ricard Clau
 
Cassandra
CassandraCassandra
Cassandra
exsuns
 
Scalable and High available Distributed File System Metadata Service Using gR...
Scalable and High available Distributed File System Metadata Service Using gR...Scalable and High available Distributed File System Metadata Service Using gR...
Scalable and High available Distributed File System Metadata Service Using gR...
Alluxio, Inc.
 

Similar a Redis (20)

Redis - The Universal NoSQL Tool
Redis - The Universal NoSQL ToolRedis - The Universal NoSQL Tool
Redis - The Universal NoSQL Tool
 
Redis acc 2015_eng
Redis acc 2015_engRedis acc 2015_eng
Redis acc 2015_eng
 
Cassandra vs. Redis
Cassandra vs. RedisCassandra vs. Redis
Cassandra vs. Redis
 
Redis everywhere - PHP London
Redis everywhere - PHP LondonRedis everywhere - PHP London
Redis everywhere - PHP London
 
Unleash the Power of Redis with Amazon ElastiCache
Unleash the Power of Redis with Amazon ElastiCache Unleash the Power of Redis with Amazon ElastiCache
Unleash the Power of Redis with Amazon ElastiCache
 
Unleash the Power of Redis with Amazon ElastiCache
Unleash the Power of Redis with Amazon ElastiCacheUnleash the Power of Redis with Amazon ElastiCache
Unleash the Power of Redis with Amazon ElastiCache
 
Speed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with RedisSpeed up your Symfony2 application and build awesome features with Redis
Speed up your Symfony2 application and build awesome features with Redis
 
Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?Key-Value-Stores -- The Key to Scaling?
Key-Value-Stores -- The Key to Scaling?
 
Intro to big data choco devday - 23-01-2014
Intro to big data   choco devday - 23-01-2014Intro to big data   choco devday - 23-01-2014
Intro to big data choco devday - 23-01-2014
 
Running MySQL on Linux
Running MySQL on LinuxRunning MySQL on Linux
Running MySQL on Linux
 
Scalable Filesystem Metadata Services with RocksDB
Scalable Filesystem Metadata Services with RocksDBScalable Filesystem Metadata Services with RocksDB
Scalable Filesystem Metadata Services with RocksDB
 
Introduction to Google BigQuery
Introduction to Google BigQueryIntroduction to Google BigQuery
Introduction to Google BigQuery
 
Redis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHPRedis Everywhere - Sunshine PHP
Redis Everywhere - Sunshine PHP
 
Managing Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using ElasticsearchManaging Security At 1M Events a Second using Elasticsearch
Managing Security At 1M Events a Second using Elasticsearch
 
Column Stores and Google BigQuery
Column Stores and Google BigQueryColumn Stores and Google BigQuery
Column Stores and Google BigQuery
 
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
AWS Webcast - Backup & Restore for ElastiCache/Redis: Getting Started & Best ...
 
Ceph Day Santa Clara: Ceph at DreamHost
Ceph Day Santa Clara: Ceph at DreamHost Ceph Day Santa Clara: Ceph at DreamHost
Ceph Day Santa Clara: Ceph at DreamHost
 
Cassandra
CassandraCassandra
Cassandra
 
Scalable and High available Distributed File System Metadata Service Using gR...
Scalable and High available Distributed File System Metadata Service Using gR...Scalable and High available Distributed File System Metadata Service Using gR...
Scalable and High available Distributed File System Metadata Service Using gR...
 
Getting started with Amazon ElastiCache
Getting started with Amazon ElastiCacheGetting started with Amazon ElastiCache
Getting started with Amazon ElastiCache
 

Más de imalik8088 (6)

Sharia
ShariaSharia
Sharia
 
Vom ewigen Aufschieben (Procrastination)
Vom ewigen Aufschieben (Procrastination)Vom ewigen Aufschieben (Procrastination)
Vom ewigen Aufschieben (Procrastination)
 
Sweden
SwedenSweden
Sweden
 
India cultural differences
India cultural differencesIndia cultural differences
India cultural differences
 
Tod Jesu (urdu: Wafat-e-Masih)
Tod Jesu (urdu: Wafat-e-Masih)Tod Jesu (urdu: Wafat-e-Masih)
Tod Jesu (urdu: Wafat-e-Masih)
 
Hadoop Einführung @codecentric
Hadoop Einführung @codecentricHadoop Einführung @codecentric
Hadoop Einführung @codecentric
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Último (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Redis