Redis and Ohm


Published on

Redis and Ohm presented by Mark Cotner to Atlanta Ruby Users group on June 9, 2010

Published in: Technology, Education
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

  • Redis and Ohm

    1. 1. Mark Cotner Redis and Ohm June 9, 2010
    2. 2. Mark Cotner Redis and Ohm June 9, 2010 Atlanta Ruby Users Group
    3. 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. 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. 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. 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. 7. Data Structures in Redis Key/Value Pairs(not to be confused with redis hash)
    8. 8. Data Structures in Redis Hash (not to be confused with key/value pairs)
    9. 9. Data Structures in Redis Arrays/Queues
    10. 10. Data Structures in Redis Sequences and Unsorted Sets
    11. 11. Data Structures in Redis Sorted Sets and Time Series Data
    12. 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. 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. 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. 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. 16. Ohm - Fun with Patterns Group ToDo Person Person Person Task Task Task
    17. 17. Creating the Model in Ohm
    18. 18. Working with the Model
    19. 19. More . . . Lets try an atomic operation Take 1 task from the group todo queue and assign it to a Person.
    20. 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.
    21. 21. Questions?