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

Service Oriented Disasters

Rachel Myers
February 06, 2015

Service Oriented Disasters

Deck from RubyConfAu 2015

Rachel Myers

February 06, 2015
Tweet

More Decks by Rachel Myers

Other Decks in Technology

Transcript

  1. 1. Make each class and method conceptually simple. 2. Reduce

    complexity in major code paths and in code that changes often.
  2. 2. Reduce complexity in major code paths and in code

    that changes often. 3. Complexity in stable code paths is probably acceptable. 1. Make each class and method conceptually simple.
  3. 2. Reduce complexity in major code paths and in code

    that changes often. 3. Complexity in stable code paths is more acceptable. 1. Make each class and method conceptually simple.
  4. # This class encapsulates behavior for hats that are actually

    for sale as well as hat samples we might sell. class Hat # Public: Adds a Hat to a Cart # Returns the Hat. def add_to(cart) … end # Public: Vote for a sample Hat # Returns True. def vote_yes(user) … end end the ruby
  5. # This class encapsulates behavior for hats that are actually

    for sale as well as hat samples we might sell. class Hat belongs_to :votable_hat, class_name: :Hat # Public: Adds a Hat to a Cart # Returns the Hat def add_to(cart) … end # Public: Vote for a sample Hat def vote_yes(user) … end end
  6. # This class encapsulates behavior for hats that are actually

    for sale as well as hat samples we might sell. class Hat belongs_to :votable_hat, class_name: :Hat # Public: Adds a Hat to a Cart # Returns the Hat def add_to(cart) … end # Public: Vote for a sample Hat def vote_yes(user) … end end
  7. 2. We didn’t manage our complexity; we reinforced it. 1.

    We drew the wrong lines around services. Failures:
  8. Queueing Theory! Request Response Time spent in Main App Time

    Request Response Time in Identity Service
  9. hatsforspacedogs.com helmets galea fedoras diving-bells hatsforspacedogs.com helmets galea fedoras diving-bells

    hatsforspacedogs.com helmets galea fedoras diving-bells hatsforspacedogs.com helmets galea fedoras diving-bells
  10. Shared HTML, CSS, JS & Images hatsforspacedogs.com helmets galea fedoras

    diving-bells hatsforspacedogs.com helmets galea fedoras diving-bells hatsforspacedogs.com helmets galea fedoras diving-bells hatsforspacedogs.com helmets galea fedoras diving-bells
  11. Problems to solve: 1. Avoid repeating HTML, CSS, JS and

    images across applications. 2. Asset changes should update at the same time.
  12. Conclusions 1. SOA works for good code. 2. SOA works

    when code needs to run in multiple places.
  13. Conclusions 2. SOA works when it needs to run in

    multiple places. 3. SOA works when it doesn’t create a bottleneck for the main app. 1. SOA works for good code.