SlideShare una empresa de Scribd logo
1 de 21
Mark Cotner
Redis and Ohm
June 9, 2010
Mark Cotner
Redis and Ohm
June 9, 2010



      Atlanta Ruby Users Group
It’s good to be back
 This is my 4th presentation
 I noticed on our history many of my presentations were
 remembered, but the presenter(me) was forgotten
 I guess that means the content really came across well,
 but the presenter just wasn’t memorable enough :)
 I missed you!
 I’m awksedgreep on IRC, Twitter, etc
Redis

Well beyond a simple Key-Value Store
Has data structures programmers are already familiar
with: Arrays, Hashes, Queues, and much much more
Interacting with the “DB” is no different in most cases
than interacting with these data structures
Written in C for speed
Community
Redis license is BSD
Very active community on the mailing list and IRC
(#redis on freenode)
Fast moving project. Features are requested very often
and implemented quickly.
Very stable in spite of rapid change.
Strong client support in Ruby with redis-rb and em-
redis
ORM support with Ohm, redis-objects and
DataMapper
Lets talk Patterns
 Redis is a database that thinks like a programmer
 Publish/Subscribe
 Producer/Consumer(w or w/o Blocking Queues)
 Actor
 Arrays
 Lists/Sets
 Sorted Lists/Sets(dual-indexed lists)
 Object Properties by Primary Key(using Hashes, similar
 to the Active Record pattern)
 Sequence
Data Structures in Redis
Key/Value Pairs(not to be confused with redis hash)
Data Structures in Redis
Hash (not to be confused with key/value pairs)
Data Structures in Redis
         Arrays/Queues
Data Structures in Redis
     Sequences and Unsorted Sets
Data Structures in Redis
    Sorted Sets and Time Series Data
Redis and Ruby

redis-rb - Widely used redis gem
em-redis - Event Machine(async) redis gem
Ohm - Object Relational Mapper for Redis, which now
uses redis hashes
resque - Relatively simple producer/consumer
background workers using redis
redis-TextSearch - Full text searching for AR using redis
Redis and Ruby continued
redis-store - Session and cache store for Rack/Rails/
Sinatra
Redis::Objects - Integrates with existing ORM, provides
a more OOP style functionality to redis
dm-redis-adapter - Full DataMapper functionality for
redis(Yes, it will work in Rails 3.0)
redactor - Actor Pattern on redis
more?
redis-rb

 Just reached 2.0 milestone
 Supports all major redis features through 2.0 including
 Hashes
 Thread Safe(with :thread_safe => true flag)
 Very easy to use
Ohm - ORM for Redis

Has a redis feel to it (Person[1] vs Person.find(1))
Uses hashes for attributes now, extremely fast
Supports simple data validations
Allows relations to be stored as sets or lists(collection)
Ohm - Fun with Patterns
                  Group




       ToDo               Person
                          Person
                           Person
         Task
          Task
           Task
Creating the Model in Ohm
Working with the Model
More . . .
        Lets try an atomic operation




 Take 1 task from the group todo queue and
            assign it to a Person.
Future of Redis
 Commercial Support - Likely from VMWare
 VM - Indexes will be stored in memory, data will be
 written to disk
 UDP - Many operations will be supported by
 lightweight UDP
 Performance - Seems like antirez finds a performance
 enhancement every few days
 Commands - New requests for commands come in all
 the time and seem to be implemented quickly if they
 make sense.
Questions?

Más contenido relacionado

Similar a Redis and Ohm

Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and Redisjavier ramirez
 
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
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesJon Meredith
 
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
 
Real time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerReal time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerAjeet Singh Raina
 
Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02sagaroceanic11
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to RedisArnab Mitra
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Redis Labs
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!Andraz Tori
 
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020Redis Labs
 

Similar a Redis and Ohm (20)

Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Fun with Ruby and Redis
Fun with Ruby and RedisFun with Ruby and Redis
Fun with Ruby and 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...
 
Redis meetup
Redis meetupRedis meetup
Redis meetup
 
Front Range PHP NoSQL Databases
Front Range PHP NoSQL DatabasesFront Range PHP NoSQL Databases
Front Range PHP NoSQL Databases
 
Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
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
 
Ruby on rails for beginers
Ruby on rails for beginersRuby on rails for beginers
Ruby on rails for beginers
 
Redis by-hari
Redis by-hariRedis by-hari
Redis by-hari
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Real time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and DockerReal time Object Detection and Analytics using RedisEdge and Docker
Real time Object Detection and Analytics using RedisEdge and Docker
 
Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02Rubyonrails 120409061835-phpapp02
Rubyonrails 120409061835-phpapp02
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Ruby openfest
Ruby openfestRuby openfest
Ruby openfest
 
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
Moving Beyond Cache by Yiftach Shoolman Redis Labs - Redis Day Seattle 2020
 
Bhavesh ro r
Bhavesh ro rBhavesh ro r
Bhavesh ro r
 
SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!SQL or NoSQL, that is the question!
SQL or NoSQL, that is the question!
 
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
Moving Beyond Cache by Yiftach Shoolman - Redis Day Bangalore 2020
 
Rails Concept
Rails ConceptRails Concept
Rails Concept
 

Último

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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
 

Último (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 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
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 

Redis and Ohm

  • 1. Mark Cotner Redis and Ohm June 9, 2010
  • 2. Mark Cotner Redis and Ohm June 9, 2010 Atlanta Ruby Users Group
  • 3. It’s good to be back This is my 4th presentation I noticed on our history many of my presentations were remembered, but the presenter(me) was forgotten I guess that means the content really came across well, but the presenter just wasn’t memorable enough :) I missed you! I’m awksedgreep on IRC, Twitter, etc
  • 4. Redis Well beyond a simple Key-Value Store Has data structures programmers are already familiar with: Arrays, Hashes, Queues, and much much more Interacting with the “DB” is no different in most cases than interacting with these data structures Written in C for speed
  • 5. Community Redis license is BSD Very active community on the mailing list and IRC (#redis on freenode) Fast moving project. Features are requested very often and implemented quickly. Very stable in spite of rapid change. Strong client support in Ruby with redis-rb and em- redis ORM support with Ohm, redis-objects and DataMapper
  • 6. Lets talk Patterns Redis is a database that thinks like a programmer Publish/Subscribe Producer/Consumer(w or w/o Blocking Queues) Actor Arrays Lists/Sets Sorted Lists/Sets(dual-indexed lists) Object Properties by Primary Key(using Hashes, similar to the Active Record pattern) Sequence
  • 7. Data Structures in Redis Key/Value Pairs(not to be confused with redis hash)
  • 8. Data Structures in Redis Hash (not to be confused with key/value pairs)
  • 9. Data Structures in Redis Arrays/Queues
  • 10. Data Structures in Redis Sequences and Unsorted Sets
  • 11. Data Structures in Redis Sorted Sets and Time Series Data
  • 12. Redis and Ruby redis-rb - Widely used redis gem em-redis - Event Machine(async) redis gem Ohm - Object Relational Mapper for Redis, which now uses redis hashes resque - Relatively simple producer/consumer background workers using redis redis-TextSearch - Full text searching for AR using redis
  • 13. Redis and Ruby continued redis-store - Session and cache store for Rack/Rails/ Sinatra Redis::Objects - Integrates with existing ORM, provides a more OOP style functionality to redis dm-redis-adapter - Full DataMapper functionality for redis(Yes, it will work in Rails 3.0) redactor - Actor Pattern on redis more?
  • 14. redis-rb Just reached 2.0 milestone Supports all major redis features through 2.0 including Hashes Thread Safe(with :thread_safe => true flag) Very easy to use
  • 15. Ohm - ORM for Redis Has a redis feel to it (Person[1] vs Person.find(1)) Uses hashes for attributes now, extremely fast Supports simple data validations Allows relations to be stored as sets or lists(collection)
  • 16. Ohm - Fun with Patterns Group ToDo Person Person Person Task Task Task
  • 19. More . . . Lets try an atomic operation Take 1 task from the group todo queue and assign it to a Person.
  • 20. Future of Redis Commercial Support - Likely from VMWare VM - Indexes will be stored in memory, data will be written to disk UDP - Many operations will be supported by lightweight UDP Performance - Seems like antirez finds a performance enhancement every few days Commands - New requests for commands come in all the time and seem to be implemented quickly if they make sense.

Notas del editor