Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
CHRIS WANSTRATH
   ERR FREE

   [ http://errfree.com ]
50,000,000 pages

 no downtime
memcached.
Memcaching Rails
  CHRIS WANSTRATH
     ERR FREE
     [ http://errfree.com ]
Memcaching Rails
  CHRIS WANSTRATH
     ERR FREE
     [ http://errfree.com ]
chris wanstrath
           railsconf 2007




 kickin’ ass
with cache-fu
{}
class Memcache < Hash
  undef :each, :keys
end
class Memcache < DRbHash
  undef :each, :keys
end
$ memcached -vv
<3 server listening
<7 new client connection
<7 get app-test:Story:1
>7 END
<7 set app-test:Story:2 0
>7 S...
$ memcached -vv
<3 server listening
<7 new client connection
<7 get app-test:Story:1
>7 END
<7 set app-test:Story:2 0
>7 S...
YAGNI
UYRDNI
UYRDNI
(unless you really do need it)
class Presentation < ActiveRecord::Base

      def self.get_cache(id)
          if data = @cache.get(id)
            data
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Kickin' Ass with Cache-Fu (without notes)
Upcoming SlideShare
Loading in …5
×

Kickin' Ass with Cache-Fu (without notes)

12,032 views

Published on

My memcached talk at RailsConf 2007 (without notes). See the blog post: http://errtheblog.com/post/4872

Published in: Technology, Design

Kickin' Ass with Cache-Fu (without notes)

  1. CHRIS WANSTRATH ERR FREE [ http://errfree.com ]
  2. 50,000,000 pages no downtime
  3. memcached.
  4. Memcaching Rails CHRIS WANSTRATH ERR FREE [ http://errfree.com ]
  5. Memcaching Rails CHRIS WANSTRATH ERR FREE [ http://errfree.com ]
  6. chris wanstrath railsconf 2007 kickin’ ass with cache-fu
  7. {}
  8. class Memcache < Hash undef :each, :keys end
  9. class Memcache < DRbHash undef :each, :keys end
  10. $ memcached -vv <3 server listening <7 new client connection <7 get app-test:Story:1 >7 END <7 set app-test:Story:2 0 >7 STORED <7 delete app-test:Story:1 >7 DELETED
  11. $ memcached -vv <3 server listening <7 new client connection <7 get app-test:Story:1 >7 END <7 set app-test:Story:2 0 >7 STORED <7 delete app-test:Story:1 >7 DELETED
  12. YAGNI
  13. UYRDNI
  14. UYRDNI (unless you really do need it)
  15. class Presentation < ActiveRecord::Base def self.get_cache(id) if data = @cache.get(id) data

×