Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Riak at Braintree

Riak at Braintree

Why Braintree chose Riak as a highly available data store and how it uses Riak in Rails applications.

Avatar for benmills

benmills

July 11, 2012
Tweet

More Decks by benmills

Other Decks in Programming

Transcript

  1. Challenges * 150 requests/second at peak * Majority of requests

    are meaningful * Write heavy * Zero downtime
  2. person = Person.new( :first_name => "Ben", :last_name => "Mills" :age

    => 24 ) PersonRepository.save(person) PersonRepository.find_by_id(person.id) PersonRepository.find_by_age(24)
  3. class Person include Curator::Model attr_accessor :id, :age def name if

    @name @name else “#{@first_name} #{last_name}” end end end
  4. class ConsolidateName < Curator::Migration def migrate(attributes) first_name = attributes.delete(:first_name) last_name

    = attributes.delete(:last_name) attributes.merge(:name => "#{first_name} #{last_name}") end end
  5. Q/A