SlideShare une entreprise Scribd logo
1  sur  26
Télécharger pour lire hors ligne
Riak at Posterous
        Julio Capote




  San Francisco Riak Meetup
          1/18/2012
A/S/L?

• Julio Capote
• Backend Developer at Posterous
• @capotej
• Allows anyone to create multiple private or
               public spaces (blogs)
           • Around since 2008
           • Millions of posts and users
           • Tons of long tail traffic

Some of the first posts are still being accessed today due to search engines
How we store posts
• Original post body goes into MySQL
• Multiple variants are generated (nojs,
  mobile, etc)
• Expensive to generate (sanitizers,
  expanders)
Enter Variant Cache

          • A generic read/write-through cache library
          • Started with Memcache
          • Moved to Redis



At the time disk store looked promising, so we moved from memcache to redis
Redis is awesome, but
           • Requires both the key and value go into
               memory
           • Terrible disk store performance
           • Even with 3 machines with 64gb ram,
               couldn’t fit entire working set
           • Forced to set a TTL


redis wasn’t really designed to ever hit the disk
The Dream
What we wanted
• Key/Value store
• Disk backed
• Built in distribution
• Use less boxes to serve more users
• Consistent performance over raw
  performance
Percona MySQL /
 HandlerSocket
MySQL /
       HandlerSocket
              The Good
• Great performance
• Can handle a huge number of rows
• Mature / Safe (at least the mysql part)
MySQL /
                     HandlerSocket
                           The Bad

          • Sharding definitely not built in
          • HandlerSocket is pretty much abandoned


No support going forward
MongoDB

               The Good
• Crazy fast
• Built in sharding support
• ...did I mention it was fast?
MongoDB

                                      The Bad

           • 30% standard deviation on fetch times (!)
           • Would falsely acknowledge a write


This is probably tunable, but still
Riak + Bitcask
             The Good
• Distributed by default
• Consistent and predictable performance
• Highly concurrent, no perf degradation
• Ops guy loves it!
Riak + Bitcask
                                  The Bad
          • Not crazy fast
           • Stuck it behind memcache
           • Still way faster than generating
          • No multi get support

write and read through memcache
Riak in production

• Started using our 3 node cluster for the
  global production cache
• Accidentally turned off a node
• Keys rebalanced, site didn’t skip a beat
• No one even noticed till hours later
Stats

• 3 nodes
• 2600+ requests/second
• 300+ GB
• ~200 million keys
• 10 GB memcache/host
#Protips
• All nodes can serve all requests, so...
 • Use a vip, or...
 • Pass all cluster nodes to client driver
    (thanks @aphyr!)
• Use curb instead of net/http
• Use Keep Alive
Any Questions?
Thanks for listening!
              Special thanks to
              @twoism
              @vincentchu
              @kangchen
              @argv0
              @pharkmillups
              @seancribbs
              @aphyr
              @jrecursive

Contenu connexe

Tendances

Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
nohuhu
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
webhostingguy
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
nohuhu
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
nohuhu
 
Less\sass done right in .NET
Less\sass done right in .NETLess\sass done right in .NET
Less\sass done right in .NET
PawelPabich
 
Provisioning Rails Servers with Ansible
Provisioning Rails Servers with AnsibleProvisioning Rails Servers with Ansible
Provisioning Rails Servers with Ansible
Radamanthus Batnag
 

Tendances (20)

Functional Programming in PHP
Functional Programming in PHPFunctional Programming in PHP
Functional Programming in PHP
 
VersaPay's Tools for Happyfficient Developers
VersaPay's Tools for Happyfficient DevelopersVersaPay's Tools for Happyfficient Developers
VersaPay's Tools for Happyfficient Developers
 
Automating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and PerlAutomating JavaScript testing with Jasmine and Perl
Automating JavaScript testing with Jasmine and Perl
 
WordPress 4.4 and Beyond
WordPress 4.4 and BeyondWordPress 4.4 and Beyond
WordPress 4.4 and Beyond
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York Times
 
Beyond Apache: Faster Web Servers
Beyond Apache: Faster Web ServersBeyond Apache: Faster Web Servers
Beyond Apache: Faster Web Servers
 
Developing Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScriptDeveloping Rich Internet Applications with Perl and JavaScript
Developing Rich Internet Applications with Perl and JavaScript
 
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ BrnoJenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
Jenkins-Koji plugin presentation on Python & Ruby devel group @ Brno
 
2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote
 
Proxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::StaticperlProxying DBI with DBD::Gofer and App::Staticperl
Proxying DBI with DBD::Gofer and App::Staticperl
 
Online.sg #9 "LLVM" Opening & Closing
Online.sg #9 "LLVM" Opening & ClosingOnline.sg #9 "LLVM" Opening & Closing
Online.sg #9 "LLVM" Opening & Closing
 
Trying Out Tomorrow’s WordPress Today
Trying Out Tomorrow’s WordPress TodayTrying Out Tomorrow’s WordPress Today
Trying Out Tomorrow’s WordPress Today
 
It Takes a Village to Make WordPress
It Takes a Village to Make WordPressIt Takes a Village to Make WordPress
It Takes a Village to Make WordPress
 
Ignite Devops Fast Moving Software
Ignite Devops Fast Moving SoftwareIgnite Devops Fast Moving Software
Ignite Devops Fast Moving Software
 
Less\sass done right in .NET
Less\sass done right in .NETLess\sass done right in .NET
Less\sass done right in .NET
 
REST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesREST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York Times
 
DevTools at Etsy
DevTools at EtsyDevTools at Etsy
DevTools at Etsy
 
Unit Testing in JavaScript
Unit Testing in JavaScriptUnit Testing in JavaScript
Unit Testing in JavaScript
 
Provisioning Rails Servers with Ansible
Provisioning Rails Servers with AnsibleProvisioning Rails Servers with Ansible
Provisioning Rails Servers with Ansible
 

Similaire à Riak at Posterous

A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
DATAVERSITY
 
London devops logging
London devops loggingLondon devops logging
London devops logging
Tomas Doran
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
xlight
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
Tomas Doran
 

Similaire à Riak at Posterous (20)

Keeping MongoDB Data Safe
Keeping MongoDB Data SafeKeeping MongoDB Data Safe
Keeping MongoDB Data Safe
 
High Scalability Toronto: Meetup #2
High Scalability Toronto: Meetup #2High Scalability Toronto: Meetup #2
High Scalability Toronto: Meetup #2
 
Ruby and Distributed Storage Systems
Ruby and Distributed Storage SystemsRuby and Distributed Storage Systems
Ruby and Distributed Storage Systems
 
Rapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The WebRapid Evolution of Web Dev? aka Talking About The Web
Rapid Evolution of Web Dev? aka Talking About The Web
 
Webinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case StudyWebinar - DreamObjects/Ceph Case Study
Webinar - DreamObjects/Ceph Case Study
 
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
A Case Study of NoSQL Adoption: What Drove Wordnik Non-Relational?
 
Memcached Code Camp 2009
Memcached Code Camp 2009Memcached Code Camp 2009
Memcached Code Camp 2009
 
From 100s to 100s of Millions
From 100s to 100s of MillionsFrom 100s to 100s of Millions
From 100s to 100s of Millions
 
Putting Kafka Into Overdrive
Putting Kafka Into OverdrivePutting Kafka Into Overdrive
Putting Kafka Into Overdrive
 
London devops logging
London devops loggingLondon devops logging
London devops logging
 
Fixing twitter
Fixing twitterFixing twitter
Fixing twitter
 
Fixing_Twitter
Fixing_TwitterFixing_Twitter
Fixing_Twitter
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...Fixing Twitter  Improving The Performance And Scalability Of The Worlds Most ...
Fixing Twitter Improving The Performance And Scalability Of The Worlds Most ...
 
EhTrace -- RoP Hooks
EhTrace -- RoP HooksEhTrace -- RoP Hooks
EhTrace -- RoP Hooks
 
Caching your rails application
Caching your rails applicationCaching your rails application
Caching your rails application
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
C* Summit 2013: How Not to Use Cassandra by Axel Liljencrantz
C* Summit 2013: How Not to Use Cassandra by Axel LiljencrantzC* Summit 2013: How Not to Use Cassandra by Axel Liljencrantz
C* Summit 2013: How Not to Use Cassandra by Axel Liljencrantz
 
Dibi Conference 2012
Dibi Conference 2012Dibi Conference 2012
Dibi Conference 2012
 
Messaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new frameworkMessaging, interoperability and log aggregation - a new framework
Messaging, interoperability and log aggregation - a new framework
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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...
 

Riak at Posterous

  • 1. Riak at Posterous Julio Capote San Francisco Riak Meetup 1/18/2012
  • 2. A/S/L? • Julio Capote • Backend Developer at Posterous • @capotej
  • 3. • Allows anyone to create multiple private or public spaces (blogs) • Around since 2008 • Millions of posts and users • Tons of long tail traffic Some of the first posts are still being accessed today due to search engines
  • 4. How we store posts • Original post body goes into MySQL • Multiple variants are generated (nojs, mobile, etc) • Expensive to generate (sanitizers, expanders)
  • 5. Enter Variant Cache • A generic read/write-through cache library • Started with Memcache • Moved to Redis At the time disk store looked promising, so we moved from memcache to redis
  • 6. Redis is awesome, but • Requires both the key and value go into memory • Terrible disk store performance • Even with 3 machines with 64gb ram, couldn’t fit entire working set • Forced to set a TTL redis wasn’t really designed to ever hit the disk
  • 7.
  • 9.
  • 10. What we wanted • Key/Value store • Disk backed • Built in distribution • Use less boxes to serve more users • Consistent performance over raw performance
  • 11. Percona MySQL / HandlerSocket
  • 12. MySQL / HandlerSocket The Good • Great performance • Can handle a huge number of rows • Mature / Safe (at least the mysql part)
  • 13. MySQL / HandlerSocket The Bad • Sharding definitely not built in • HandlerSocket is pretty much abandoned No support going forward
  • 14.
  • 15. MongoDB The Good • Crazy fast • Built in sharding support • ...did I mention it was fast?
  • 16.
  • 17. MongoDB The Bad • 30% standard deviation on fetch times (!) • Would falsely acknowledge a write This is probably tunable, but still
  • 18.
  • 19. Riak + Bitcask The Good • Distributed by default • Consistent and predictable performance • Highly concurrent, no perf degradation • Ops guy loves it!
  • 20. Riak + Bitcask The Bad • Not crazy fast • Stuck it behind memcache • Still way faster than generating • No multi get support write and read through memcache
  • 21. Riak in production • Started using our 3 node cluster for the global production cache • Accidentally turned off a node • Keys rebalanced, site didn’t skip a beat • No one even noticed till hours later
  • 22.
  • 23. Stats • 3 nodes • 2600+ requests/second • 300+ GB • ~200 million keys • 10 GB memcache/host
  • 24. #Protips • All nodes can serve all requests, so... • Use a vip, or... • Pass all cluster nodes to client driver (thanks @aphyr!) • Use curb instead of net/http • Use Keep Alive
  • 26. Thanks for listening! Special thanks to @twoism @vincentchu @kangchen @argv0 @pharkmillups @seancribbs @aphyr @jrecursive