SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Redis On Rails
Marc Beaupré-Pham
Lagoa.com
what is redis?
redis is key-value data structure store
basics
Q: Speed?
A: Fast. ~Memcached
Q: Persistence?
A: In Memory. Store to disk using
Snapshoting or Append-Only File (AOF)
Q: Guts?
A: Written in C
Single Threaded
Atomic commands
Zero Dependencies
Q: Installation?
A: sudo apt-get install redis-server
brew install redis
who else?
Many more…
+
gem ‘redis-rails’
gem 'hiredis', '~> 0.4.5'
pool
gem 'connection_pool’
$redis = ConnectionPool::Wrapper.new(:size => 5, :timeout => 3) do
Redis.new(:driver => :hiredis)
end
caching
redis-rails gives data cache, session store & HTTP cache
Rails.cache.write(‘key’,‘Hello Montreal.rb’)
session[:key] = ‘Hello Montreal.rb’
fresh_when last_modified: @posts.maximum(:updated_at)
why redis?
Expiring
Stores objects
lists
sets
hashes
strings
job queues
Examples:
Resque
Sidekiq
why redis?
Queues (through lists)
RPUSH LPUSH RPOP LPOP
pub/sub
Examples:
websockets
messaging
#comment.rb
after_create {
$redis.publish(’new_comment’, comment.attributes)
}
#node.js
var sub_client = redis.createClient();
sub_client.addListener('message', broadcastToClients);
why redis?
Stable
Fast
primary db?
data structure
-View Counts (incr)
-Metrics (incr)
-Who’s Online (w/ union)
$redis.with do |redis_client|
…
raise 'Unable to acquire resource' unless redis_client.multi do |r|
[r.SETNX(@key, @token),
r.SETNX(@token, @key)]
end.all?{|result| result == 1 }
…
end
Locks & Semaphores (setnx and del)
Features
Primitives
– Lists
– (sorted) Sets
– Hashes
– Strings
Pub/Sub
Queues (through lists)
Expiration

Weitere ähnliche Inhalte

Was ist angesagt?

Ceph Day Berlin: Ceph and iSCSI in a high availability setup
Ceph Day Berlin: Ceph and iSCSI in a high availability setupCeph Day Berlin: Ceph and iSCSI in a high availability setup
Ceph Day Berlin: Ceph and iSCSI in a high availability setupCeph Community
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redisTanu Siwag
 
Boost your website by running PHP on Nginx
Boost your website by running PHP on NginxBoost your website by running PHP on Nginx
Boost your website by running PHP on NginxHarald Zeitlhofer
 
The Need For Speed: Caching Fundamentals
The Need For Speed: Caching FundamentalsThe Need For Speed: Caching Fundamentals
The Need For Speed: Caching FundamentalsFrankie Jarrett
 
Aerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analyticsAerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analyticsAerospike
 
StripeEu Twistedbytes Presentation
StripeEu Twistedbytes PresentationStripeEu Twistedbytes Presentation
StripeEu Twistedbytes Presentationtwistedbytes
 
PHP projects beyond the LAMP stack
PHP projects beyond the LAMP stackPHP projects beyond the LAMP stack
PHP projects beyond the LAMP stackCodemotion
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...
Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...
Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...Aerospike
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeMichael May
 
EWD 3 Training Course Part 17: Introduction to Global Storage Databases
EWD 3 Training Course Part 17: Introduction to Global Storage DatabasesEWD 3 Training Course Part 17: Introduction to Global Storage Databases
EWD 3 Training Course Part 17: Introduction to Global Storage DatabasesRob Tweed
 
Tales Of The Black Knight - Keeping EverythingMe running
Tales Of The Black Knight - Keeping EverythingMe runningTales Of The Black Knight - Keeping EverythingMe running
Tales Of The Black Knight - Keeping EverythingMe runningDvir Volk
 
Work WIth Redis and Perl
Work WIth Redis and PerlWork WIth Redis and Perl
Work WIth Redis and PerlBrett Estrade
 
Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)Amir Sedighi
 
17937858 squid-server - [the-xp.blogspot.com]
17937858 squid-server - [the-xp.blogspot.com]17937858 squid-server - [the-xp.blogspot.com]
17937858 squid-server - [the-xp.blogspot.com]Krisman Tarigan
 

Was ist angesagt? (20)

Ceph Day Berlin: Ceph and iSCSI in a high availability setup
Ceph Day Berlin: Ceph and iSCSI in a high availability setupCeph Day Berlin: Ceph and iSCSI in a high availability setup
Ceph Day Berlin: Ceph and iSCSI in a high availability setup
 
Redis 101
Redis 101Redis 101
Redis 101
 
Introduction to redis
Introduction to redisIntroduction to redis
Introduction to redis
 
Redis database
Redis databaseRedis database
Redis database
 
Boost your website by running PHP on Nginx
Boost your website by running PHP on NginxBoost your website by running PHP on Nginx
Boost your website by running PHP on Nginx
 
The Need For Speed: Caching Fundamentals
The Need For Speed: Caching FundamentalsThe Need For Speed: Caching Fundamentals
The Need For Speed: Caching Fundamentals
 
Aerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analyticsAerospike DB and Storm for real-time analytics
Aerospike DB and Storm for real-time analytics
 
StripeEu Twistedbytes Presentation
StripeEu Twistedbytes PresentationStripeEu Twistedbytes Presentation
StripeEu Twistedbytes Presentation
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
PHP projects beyond the LAMP stack
PHP projects beyond the LAMP stackPHP projects beyond the LAMP stack
PHP projects beyond the LAMP stack
 
Running PHP on Nginx
Running PHP on NginxRunning PHP on Nginx
Running PHP on Nginx
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...
Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...
Combining Real-time and Batch Analytics with NoSQL, Storm and Hadoop - NoSQL ...
 
Rails Caching Secrets from the Edge
Rails Caching Secrets from the EdgeRails Caching Secrets from the Edge
Rails Caching Secrets from the Edge
 
EWD 3 Training Course Part 17: Introduction to Global Storage Databases
EWD 3 Training Course Part 17: Introduction to Global Storage DatabasesEWD 3 Training Course Part 17: Introduction to Global Storage Databases
EWD 3 Training Course Part 17: Introduction to Global Storage Databases
 
Tales Of The Black Knight - Keeping EverythingMe running
Tales Of The Black Knight - Keeping EverythingMe runningTales Of The Black Knight - Keeping EverythingMe running
Tales Of The Black Knight - Keeping EverythingMe running
 
Work WIth Redis and Perl
Work WIth Redis and PerlWork WIth Redis and Perl
Work WIth Redis and Perl
 
Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)Elasticsearch 1.x Cluster Installation (VirtualBox)
Elasticsearch 1.x Cluster Installation (VirtualBox)
 
17937858 squid-server - [the-xp.blogspot.com]
17937858 squid-server - [the-xp.blogspot.com]17937858 squid-server - [the-xp.blogspot.com]
17937858 squid-server - [the-xp.blogspot.com]
 

Andere mochten auch

Redis on Rails at RedDotRubyConference 2012
Redis on Rails at RedDotRubyConference 2012Redis on Rails at RedDotRubyConference 2012
Redis on Rails at RedDotRubyConference 2012Obie Fernandez
 
Living bythe Book Observation
Living bythe Book ObservationLiving bythe Book Observation
Living bythe Book Observationguest60214a
 
Redis on Rails (RedDotRubyConf 2012)
Redis on Rails (RedDotRubyConf 2012)Redis on Rails (RedDotRubyConf 2012)
Redis on Rails (RedDotRubyConf 2012)Obie Fernandez
 
Living by the Book Week 1
Living by the Book Week 1Living by the Book Week 1
Living by the Book Week 1John Shapiro
 
iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...
iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...
iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...Leonardo "Hackin" Freire
 
Living by the Book Week 2
Living by the Book Week 2Living by the Book Week 2
Living by the Book Week 2John Shapiro
 

Andere mochten auch (11)

Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]Hacking Twitter API [ Giran Siege ]
Hacking Twitter API [ Giran Siege ]
 
Redis on Rails at RedDotRubyConference 2012
Redis on Rails at RedDotRubyConference 2012Redis on Rails at RedDotRubyConference 2012
Redis on Rails at RedDotRubyConference 2012
 
Photoimpa
PhotoimpaPhotoimpa
Photoimpa
 
Brochure Masters NL
Brochure Masters NLBrochure Masters NL
Brochure Masters NL
 
Living bythe Book Observation
Living bythe Book ObservationLiving bythe Book Observation
Living bythe Book Observation
 
Redis on Rails (RedDotRubyConf 2012)
Redis on Rails (RedDotRubyConf 2012)Redis on Rails (RedDotRubyConf 2012)
Redis on Rails (RedDotRubyConf 2012)
 
Living by the Book Week 1
Living by the Book Week 1Living by the Book Week 1
Living by the Book Week 1
 
iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...
iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...
iMasters DevCommerce 2016 - A difícil tarefa de ser TI numa empresa de varejo...
 
The bible.w1
The bible.w1The bible.w1
The bible.w1
 
HTML5 for Mobile
HTML5 for MobileHTML5 for Mobile
HTML5 for Mobile
 
Living by the Book Week 2
Living by the Book Week 2Living by the Book Week 2
Living by the Book Week 2
 

Ähnlich wie Redis

Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Dinh Pham
 
(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep DiveAmazon Web Services
 
quickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminquickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminjorgesimao71
 
Redispresentation apac2012
Redispresentation apac2012Redispresentation apac2012
Redispresentation apac2012Ankur Gupta
 
Redis and its many use cases
Redis and its many use casesRedis and its many use cases
Redis and its many use casesChristian Joudrey
 
This is redis - feature and usecase
This is redis - feature and usecaseThis is redis - feature and usecase
This is redis - feature and usecaseKris Jeong
 
phptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorialphptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorialWim Godden
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Wim Godden
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalabilityWim Godden
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariJoseph Scott
 
Clug 2011 March web server optimisation
Clug 2011 March  web server optimisationClug 2011 March  web server optimisation
Clug 2011 March web server optimisationgrooverdan
 
Developing a Redis Module - Hackathon Kickoff
 Developing a Redis Module - Hackathon Kickoff Developing a Redis Module - Hackathon Kickoff
Developing a Redis Module - Hackathon KickoffItamar Haber
 
Zend Con 2008 Slides
Zend Con 2008 SlidesZend Con 2008 Slides
Zend Con 2008 Slidesmkherlakian
 
Amazon Elasticache Deep Dive - March 2017 AWS Online Tech Talks
Amazon Elasticache Deep Dive - March 2017 AWS Online Tech TalksAmazon Elasticache Deep Dive - March 2017 AWS Online Tech Talks
Amazon Elasticache Deep Dive - March 2017 AWS Online Tech TalksAmazon Web Services
 

Ähnlich wie Redis (20)

Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...Beyond relational database - Building high performance websites using Redis a...
Beyond relational database - Building high performance websites using Redis a...
 
(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive(DAT407) Amazon ElastiCache: Deep Dive
(DAT407) Amazon ElastiCache: Deep Dive
 
Redis
RedisRedis
Redis
 
quickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-adminquickguide-einnovator-10-redis-admin
quickguide-einnovator-10-redis-admin
 
Redispresentation apac2012
Redispresentation apac2012Redispresentation apac2012
Redispresentation apac2012
 
Redis and its many use cases
Redis and its many use casesRedis and its many use cases
Redis and its many use cases
 
This is redis - feature and usecase
This is redis - feature and usecaseThis is redis - feature and usecase
This is redis - feature and usecase
 
phptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorialphptek13 - Caching and tuning fun tutorial
phptek13 - Caching and tuning fun tutorial
 
Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012Caching and tuning fun for high scalability @ FOSDEM 2012
Caching and tuning fun for high scalability @ FOSDEM 2012
 
Java at lifeblob
Java at lifeblobJava at lifeblob
Java at lifeblob
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Redis by-hari
Redis by-hariRedis by-hari
Redis by-hari
 
Caching and tuning fun for high scalability
Caching and tuning fun for high scalabilityCaching and tuning fun for high scalability
Caching and tuning fun for high scalability
 
Redis 101
Redis 101Redis 101
Redis 101
 
Redis acc
Redis accRedis acc
Redis acc
 
Site Performance - From Pinto to Ferrari
Site Performance - From Pinto to FerrariSite Performance - From Pinto to Ferrari
Site Performance - From Pinto to Ferrari
 
Clug 2011 March web server optimisation
Clug 2011 March  web server optimisationClug 2011 March  web server optimisation
Clug 2011 March web server optimisation
 
Developing a Redis Module - Hackathon Kickoff
 Developing a Redis Module - Hackathon Kickoff Developing a Redis Module - Hackathon Kickoff
Developing a Redis Module - Hackathon Kickoff
 
Zend Con 2008 Slides
Zend Con 2008 SlidesZend Con 2008 Slides
Zend Con 2008 Slides
 
Amazon Elasticache Deep Dive - March 2017 AWS Online Tech Talks
Amazon Elasticache Deep Dive - March 2017 AWS Online Tech TalksAmazon Elasticache Deep Dive - March 2017 AWS Online Tech Talks
Amazon Elasticache Deep Dive - March 2017 AWS Online Tech Talks
 

Kürzlich hochgeladen

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 

Kürzlich hochgeladen (20)

Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 

Redis

Hinweis der Redaktion

  1. So, what's it all about, I thought I would just start by quickly going over the basics. But I'm not going to dwell for too long about what redis is, because I want this talk to really be more about what you can do with it.
  2. So, speed-wise, most benchmarks put it at a little bit slower or a little bit faster than memcached. It doesn't really matter which, it's fast.It's an in-memory data store, which backs up to disk.
  3. It's written in C, single threaded, atomic commands and installs easily with zero dependies.
  4. Who uses it? A bunch of companies. Really more than I wanted to put in this slide, so consider this just a small slice.
  5. Alright, now let's get down to what we're here for, is some talk about RUBY! Getting started is pretty darned simple, just throw a line in your gemfile and you're good to go.
  6. Oh, but oups, we forgot something!Never forget to leave home without your C bindings! hiredis does that for us.Whew, narroly missed that one.
  7. So, moving on, it's usually a good idea, if you're going to be dealing with a DB connection in an environment where you might have threading, to give yourself a pool of connections to work with. This way, you aren't waiting for one command to finish before you do something else.
  8. Alright, now that we've set up redis to our liking, what can we do with it.Well, I feel like the quickest and easier win you can get with redis is to use it for some caching. Just configure rails to use Redis in the application.rb file, and then you're good to go. And it just works. This isn't a rails tutorial, so I'm not going to really go in to any more details. It just works.
  9. So, what make redis maybe better caching that something like a file store. Well, other than speed, there is the fact that it can store objects other than just strings. It can handle lists, sets, hashes and strings like a champ. It also has built in support for expirations, so that's nice too.
  10. Apart from simple caching, you can also use it as a great job queue. From what I've been reading, it seems to be a best practice to keep jobs our of your database, despite the widespread use of things like DJ. And, there are a few job queues out there for ruby+rails that do make make use of redis as a job queue.
  11. So, what makes redis maybe better than a DB for jobs? Well, factors include the fact that with Redid'sbuiltin support for lists, you can also treat them like queues. With push and pop commands available on any list, redis makes lists work like queues just like we want.
  12. Yet another really great feature of redis is pub/sub support. Pub sub isn't something every company has a need for, but once you're already using redis for your caching and queueing needs, it just makes sense to give redis yet another responsibility. I guess we're all here because we think the future of technology is in the cloud (or you just love ruby enough to put up with all these rails guys/gals), then you might have used websockets in your application. And if you have, then you might have decided to go with a technology other than ruby on rails. Perhaps something more evented. So, whatever your technology choice, pub/sub comes very much in handy when trying to communicate with services around your infrastructure. And, with clients available in so many languages, choosing redis is never hard.
  13. So, why choose redis for this particular task? Well, do you really need any more reasons other than the fact that it is stable and fast? I think the other reason we've ever had a redis machine go down was because it ran out of membory or disk space.
  14. Alright, what about using redis as your primary database? Well, I can't reallly comment on that since I've never done it. It might be a good idea if that’s your thing. But, the point I want to re-iterate, is that I don’t see it as an either-or decision. I think you should use both, and divide the work according them depending the specifics of your use case.
  15. Alright, there's still more you can use redis for. A lot of people get a lot of value out of using redis for for other tasks around their infrastructure. Use cases you might want to consider using redis with are counting page views, recording metrics. This is really nice if you use redis's built in `increment` function.Also, maintaining a set of users that are presently online. This works really well if you combine redis's built-in union support, so you can find out who's online, and also a friend of Alice.
  16. Another more esoteric use case might be maintaining some sort of resource lock across your network. You can have a machine attempt to set a key if it doesn't already exist. That gives you the ability for one machine to hold a resource. Then, the machine can delete the key when they're done. You can even set the key to expire after a period of time if you want to timeout usage.This is an example where I attempt to set aquire a resource, and give a user of that resource a token. So, I'm combining a few features of redis here, including the `set if not existant`, `multi` for multiple command execution which I spoke of earlier, and then later we can delete those key-value pairs with an atomic multi delete operation.
  17. So yeah, redis gives you a lot in 1 simple package. There are many more features that I didn't speak up, like string maniputation, hashes, set functions, sorted sets, scripting and much more.What I really wanted to get across with this talk, is that redis is much more than a database and can be used in many creative ways. There doesn't exist another package out there that gives you so much, with such simplicity. So, my advice is to use redis everywhere. It gives you a head start in many key, early areas, and can scale with you for years to come. And, once you have it, many of your other technology choices just fall in to place around it. It also plays nice with any other service you might want to set up around your servers.