SlideShare una empresa de Scribd logo
1 de 27
What is Redis
An open source, BSD licensed,
advanced key-value store
Sponsored by
Who's using Redis?
Supported Platforms
 Linux
 Mac OS X
 FreeBSD
 Solaris
 Windows
 no official support
Supported Languages
 ActionScript
 C
 C++
 C#
 Clojure
 Common Lisp
 Dart
 Erlang
 Go
 Haskell
 Haxe
 Java
 Io
 server-side JavaScript (Node.js)
 Lua
 Objective-C
 Perl
 PHP
 Pure Data
 Python
 Ruby
 Scala
 Smalltalk
 Tcl
Data types
 Strings
 with a maximum of 512MB
 Lists
 Sets
 Sorted sets
 Set with score
 Hashes
 Perfect to represent object
Commands
 SET
 GET
 INCR
 DECR
 LPUSH
 LRANGE
 LLEN
 EXPIRE
 TTL
 SADD
 SMEMBERS
 SCARD
 SREM
 ZADD
 ZRANGE
 ZREVRANGE
 ZCARD
 ZREM
 HSET
 HGET
 HGETALL
Publish–subscribe
 Redis supports publish-subscribe mode.
 You can subscribe some topics, and
when someone publish topic matches
your interest, redis send it to you.
Lua scripting
 Scripting makes Redis much faster for
complex operations
 read-compute-write workflow
Pipelining
 NOT Redis transactions
 Does not provide atomicity
 Nothing more complicated than the fact
that Redis server is able to queue up
responses in memory
 Too many commands in a single pipeline
may cause memory issues and potentially
socket timeout.
Benchmark
without pipelining 1.185238 seconds
with pipelining 0.250783 seconds
Transactions
 All the commands in a transaction are
serialized and executed sequentially.
 Either all of the commands or none are
processed.
 Redis does not support roll backs
 A command fails to be queued
 A command fails after EXEC is called(not
supported)
More use cases
 Leader election
 Counting semaphores
 Queue
 Pizza topping problem
Persistence
 Virtual Memory
 RDB (Snapshots)
 Take snapshot in an interval
 Fast
 May loss several minutes data if kill -9
 Append Only File (AOF)
 Log-based link binlog, redo whole steps since
startup
 Auto bgrewriteaof (background rewrite AOF)
 Still fast enough
 May loss 1 second data if kill -9
Replication
 Official Master-slave replication
 Write in Master, Read in Slaves
Replication
• Official Master-slave replication
– Write in Master, Read in Slaves
Partitioning
 Redis Cluster is currently not production
ready.
 Redis Cluster is a mix between query
routing and client side partitioning.
High Availability
Redis Sentinel is a system designed to
help managing Redis instances. It
performs the following three tasks:
 Monitoring
 Notification
 Automatic failover
 Not good for production environments
High Availability(alternative)
 Virtual IP
 keepalived or heartbeat
 DRBD
High Availability(alternative)
 redis_failover project
Twemproxy
 Maintain persistent server connections
 Keep connection count on cache servers low
 Pipeline requests and responses
 Use multiple server pools simultaneously
 Proxy the complete memcached ASCII
protocol
 Easily configure server pools using a YAML file
 Use multiple hashing modes, including
consistent hashing
 Increase observability using stats exposed on
a monitoring port
Performance Benchmark
Cost of Redis Persistence
Redis web admin console
 Redis Commander
 Redmon
 Redsmin
Redis Commander
 Asfd
Compare with Memcached
Compare with Memcached
Memcached Redis
(Multi)Get V V
(Multi)Set V V
Incr/Decr V V
Deletion V V
Expiration V V
Range Queries V
Data Types V
Persistence V
Replication V
Prepend/Append V
勝
勝
勝
勝
勝
Reference
 Redis Commands
 Is memcached a dinosaur in
comparison to Redis?
 Redis Failover at Spreecast Based on
Apache ZooKeeper
 twemproxy
Questions?

Más contenido relacionado

La actualidad más candente

A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redisZhichao Liang
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAli MasudianPour
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
Redis in Practice
Redis in PracticeRedis in Practice
Redis in PracticeNoah Davis
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2Dvir Volk
 
An Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfAn Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfStephen Lorello
 
Redis Overview
Redis OverviewRedis Overview
Redis OverviewHoang Long
 
Redis cluster
Redis clusterRedis cluster
Redis clusteriammutex
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup IntroductionGregory Boissinot
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practiceEugene Fidelin
 
Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached PresentationAsif Ali
 
Hadoop Overview & Architecture
Hadoop Overview & Architecture  Hadoop Overview & Architecture
Hadoop Overview & Architecture EMC
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginnersPini Dibask
 
RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedis Labs
 

La actualidad más candente (20)

A simple introduction to redis
A simple introduction to redisA simple introduction to redis
A simple introduction to redis
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
An Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL databaseAn Introduction to REDIS NoSQL database
An Introduction to REDIS NoSQL database
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Redis in Practice
Redis in PracticeRedis in Practice
Redis in Practice
 
Introduction to redis - version 2
Introduction to redis - version 2Introduction to redis - version 2
Introduction to redis - version 2
 
An Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdfAn Introduction to Redis for Developers.pdf
An Introduction to Redis for Developers.pdf
 
Redis Overview
Redis OverviewRedis Overview
Redis Overview
 
Redis Persistence
Redis  PersistenceRedis  Persistence
Redis Persistence
 
Redis and it's data types
Redis and it's data typesRedis and it's data types
Redis and it's data types
 
Redis cluster
Redis clusterRedis cluster
Redis cluster
 
Redis 101
Redis 101Redis 101
Redis 101
 
Redis
RedisRedis
Redis
 
Redis overview
Redis overviewRedis overview
Redis overview
 
Paris Redis Meetup Introduction
Paris Redis Meetup IntroductionParis Redis Meetup Introduction
Paris Redis Meetup Introduction
 
Redis persistence in practice
Redis persistence in practiceRedis persistence in practice
Redis persistence in practice
 
Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached Presentation
 
Hadoop Overview & Architecture
Hadoop Overview & Architecture  Hadoop Overview & Architecture
Hadoop Overview & Architecture
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginners
 
RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ Twitter
 

Similar a Redis Introduction

Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redisjavier ramirez
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSAmazon Web Services
 
Experience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewExperience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewPhuwadon D
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsRedis Labs
 
quickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminquickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminjorgesimao71
 
Bootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxBootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxMaximiliano Accotto
 
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
 
New Oracle Infrastructure2
New Oracle Infrastructure2New Oracle Infrastructure2
New Oracle Infrastructure2markleeuw
 
Experience sql server on l inux and docker
Experience sql server on l inux and dockerExperience sql server on l inux and docker
Experience sql server on l inux and dockerBob Ward
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceAshok Modi
 
This is redis - feature and usecase
This is redis - feature and usecaseThis is redis - feature and usecase
This is redis - feature and usecaseKris Jeong
 
SQL Server 2017 on Linux Introduction
SQL Server 2017 on Linux IntroductionSQL Server 2017 on Linux Introduction
SQL Server 2017 on Linux IntroductionTravis Wright
 
SQL Server vNext on Linux
SQL Server vNext on LinuxSQL Server vNext on Linux
SQL Server vNext on LinuxTravis Wright
 
The roadmap for sql server 2019
The roadmap for sql server 2019The roadmap for sql server 2019
The roadmap for sql server 2019Javier Villegas
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1sprdd
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1sprdd
 
Nordic infrastructure Conference 2017 - SQL Server on Linux Overview
Nordic infrastructure Conference 2017 - SQL Server on Linux OverviewNordic infrastructure Conference 2017 - SQL Server on Linux Overview
Nordic infrastructure Conference 2017 - SQL Server on Linux OverviewTravis Wright
 

Similar a Redis Introduction (20)

Redis by-hari
Redis by-hariRedis by-hari
Redis by-hari
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redis
 
Cost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWSCost Savings at High Performance with Redis Labs and AWS
Cost Savings at High Performance with Redis Labs and AWS
 
Experience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's ViewExperience In Building Scalable Web Sites Through Infrastructure's View
Experience In Building Scalable Web Sites Through Infrastructure's View
 
What's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis LabsWhat's new with enterprise Redis - Leena Joshi, Redis Labs
What's new with enterprise Redis - Leena Joshi, Redis Labs
 
Redis tutoring
Redis tutoringRedis tutoring
Redis tutoring
 
quickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminquickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-admin
 
SQL on linux
SQL on linuxSQL on linux
SQL on linux
 
Bootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on LinuxBootcamp 2017 - SQL Server on Linux
Bootcamp 2017 - SQL Server on Linux
 
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
 
New Oracle Infrastructure2
New Oracle Infrastructure2New Oracle Infrastructure2
New Oracle Infrastructure2
 
Experience sql server on l inux and docker
Experience sql server on l inux and dockerExperience sql server on l inux and docker
Experience sql server on l inux and docker
 
DrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performanceDrupalCampLA 2011: Drupal backend-performance
DrupalCampLA 2011: Drupal backend-performance
 
This is redis - feature and usecase
This is redis - feature and usecaseThis is redis - feature and usecase
This is redis - feature and usecase
 
SQL Server 2017 on Linux Introduction
SQL Server 2017 on Linux IntroductionSQL Server 2017 on Linux Introduction
SQL Server 2017 on Linux Introduction
 
SQL Server vNext on Linux
SQL Server vNext on LinuxSQL Server vNext on Linux
SQL Server vNext on Linux
 
The roadmap for sql server 2019
The roadmap for sql server 2019The roadmap for sql server 2019
The roadmap for sql server 2019
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1
 
Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1Wheeler w 0450_linux_file_systems1
Wheeler w 0450_linux_file_systems1
 
Nordic infrastructure Conference 2017 - SQL Server on Linux Overview
Nordic infrastructure Conference 2017 - SQL Server on Linux OverviewNordic infrastructure Conference 2017 - SQL Server on Linux Overview
Nordic infrastructure Conference 2017 - SQL Server on Linux Overview
 

Más de Alex Su

Node js introduction
Node js introductionNode js introduction
Node js introductionAlex Su
 
One click deployment
One click deploymentOne click deployment
One click deploymentAlex Su
 
Scrum Introduction
Scrum IntroductionScrum Introduction
Scrum IntroductionAlex Su
 
Python decorators
Python decoratorsPython decorators
Python decoratorsAlex Su
 
Using puppet
Using puppetUsing puppet
Using puppetAlex Su
 
JMS Introduction
JMS IntroductionJMS Introduction
JMS IntroductionAlex Su
 
Spring Framework Introduction
Spring Framework IntroductionSpring Framework Introduction
Spring Framework IntroductionAlex Su
 
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionAlex Su
 
Cascading introduction
Cascading introductionCascading introduction
Cascading introductionAlex Su
 

Más de Alex Su (9)

Node js introduction
Node js introductionNode js introduction
Node js introduction
 
One click deployment
One click deploymentOne click deployment
One click deployment
 
Scrum Introduction
Scrum IntroductionScrum Introduction
Scrum Introduction
 
Python decorators
Python decoratorsPython decorators
Python decorators
 
Using puppet
Using puppetUsing puppet
Using puppet
 
JMS Introduction
JMS IntroductionJMS Introduction
JMS Introduction
 
Spring Framework Introduction
Spring Framework IntroductionSpring Framework Introduction
Spring Framework Introduction
 
Java Unit Test and Coverage Introduction
Java Unit Test and Coverage IntroductionJava Unit Test and Coverage Introduction
Java Unit Test and Coverage Introduction
 
Cascading introduction
Cascading introductionCascading introduction
Cascading introduction
 

Último

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 

Último (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Redis Introduction

  • 1.
  • 2. What is Redis An open source, BSD licensed, advanced key-value store Sponsored by
  • 4. Supported Platforms  Linux  Mac OS X  FreeBSD  Solaris  Windows  no official support
  • 5. Supported Languages  ActionScript  C  C++  C#  Clojure  Common Lisp  Dart  Erlang  Go  Haskell  Haxe  Java  Io  server-side JavaScript (Node.js)  Lua  Objective-C  Perl  PHP  Pure Data  Python  Ruby  Scala  Smalltalk  Tcl
  • 6. Data types  Strings  with a maximum of 512MB  Lists  Sets  Sorted sets  Set with score  Hashes  Perfect to represent object
  • 7. Commands  SET  GET  INCR  DECR  LPUSH  LRANGE  LLEN  EXPIRE  TTL  SADD  SMEMBERS  SCARD  SREM  ZADD  ZRANGE  ZREVRANGE  ZCARD  ZREM  HSET  HGET  HGETALL
  • 8. Publish–subscribe  Redis supports publish-subscribe mode.  You can subscribe some topics, and when someone publish topic matches your interest, redis send it to you.
  • 9. Lua scripting  Scripting makes Redis much faster for complex operations  read-compute-write workflow
  • 10. Pipelining  NOT Redis transactions  Does not provide atomicity  Nothing more complicated than the fact that Redis server is able to queue up responses in memory  Too many commands in a single pipeline may cause memory issues and potentially socket timeout. Benchmark without pipelining 1.185238 seconds with pipelining 0.250783 seconds
  • 11. Transactions  All the commands in a transaction are serialized and executed sequentially.  Either all of the commands or none are processed.  Redis does not support roll backs  A command fails to be queued  A command fails after EXEC is called(not supported)
  • 12. More use cases  Leader election  Counting semaphores  Queue  Pizza topping problem
  • 13. Persistence  Virtual Memory  RDB (Snapshots)  Take snapshot in an interval  Fast  May loss several minutes data if kill -9  Append Only File (AOF)  Log-based link binlog, redo whole steps since startup  Auto bgrewriteaof (background rewrite AOF)  Still fast enough  May loss 1 second data if kill -9
  • 14. Replication  Official Master-slave replication  Write in Master, Read in Slaves Replication • Official Master-slave replication – Write in Master, Read in Slaves
  • 15. Partitioning  Redis Cluster is currently not production ready.  Redis Cluster is a mix between query routing and client side partitioning.
  • 16. High Availability Redis Sentinel is a system designed to help managing Redis instances. It performs the following three tasks:  Monitoring  Notification  Automatic failover  Not good for production environments
  • 17. High Availability(alternative)  Virtual IP  keepalived or heartbeat  DRBD
  • 19. Twemproxy  Maintain persistent server connections  Keep connection count on cache servers low  Pipeline requests and responses  Use multiple server pools simultaneously  Proxy the complete memcached ASCII protocol  Easily configure server pools using a YAML file  Use multiple hashing modes, including consistent hashing  Increase observability using stats exposed on a monitoring port
  • 21. Cost of Redis Persistence
  • 22. Redis web admin console  Redis Commander  Redmon  Redsmin
  • 25. Compare with Memcached Memcached Redis (Multi)Get V V (Multi)Set V V Incr/Decr V V Deletion V V Expiration V V Range Queries V Data Types V Persistence V Replication V Prepend/Append V 勝 勝 勝 勝 勝
  • 26. Reference  Redis Commands  Is memcached a dinosaur in comparison to Redis?  Redis Failover at Spreecast Based on Apache ZooKeeper  twemproxy