SOA AND RUBY ON RAILS           a product case study for NYC on RailsAvi Flombaum                                July 6th ...
WHAT’S A SERVICE?      a system that responds to HTTP Requests,       usually to write, retrieve, or modify data.    Servi...
WHAT’S A SERVICE?      Services can be internal.“If you hit the Amazon.com gatewaypage, the application calls more than   ...
INTERNAL SERVICES              loads via 4 requests, total time10ms    10ms           4ms              1ms              9m...
BUT WHY SOA?Isolation (encapsulation)       rails application  Product         Authentication   News                    Se...
BUT WHY SOA?                         Isolationnews.designerpages.com               designerpages.com       Sinatra        ...
BUT WHY SOA?                    Benefits of Isolation•Robustness    You can upgrade an underlying system without effecting ...
BUT WHY SOA?                 And some more•Speed   Parallel Requests•Interoperability   Instant API•Reuse   Client wrappers
BUT WHY SOA?And finally, a practical reason
THE RUBY SOA TOOLSET                Sinatra - http://www.sinatrarb.com/ Sinatra is a DSL for quickly creating web applicat...
THE RUBY SOA TOOLSET                     httparty - a party in your http A simple module that turns a class into a basic H...
NOW FOR SOME CODE...
THANKS!
SOA on Rails
Upcoming SlideShare
Loading in …5
×

SOA on Rails

11,126 views

Published on

Published in: Technology
0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
11,126
On SlideShare
0
From Embeds
0
Number of Embeds
5,421
Actions
Shares
0
Downloads
27
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • SOA on Rails

    1. 1. SOA AND RUBY ON RAILS a product case study for NYC on RailsAvi Flombaum July 6th 2011DesignerPages.com Infogroup
    2. 2. WHAT’S A SERVICE? a system that responds to HTTP Requests, usually to write, retrieve, or modify data. Service ClientAmazon AWS: S3 DesignerPages.com HTTP PUT PUT /ergoergo.jpg HTTP/1.1 Host: designerpages.amazonaws.com Date: Wed, 12 Oct 2009 17:50:00 GMT Authorization: AWS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE= Content-Type: text/plain Content-Length: 11434 Expect: 100-continue [11434 bytes of object data]
    3. 3. WHAT’S A SERVICE? Services can be internal.“If you hit the Amazon.com gatewaypage, the application calls more than 100 services to collect data and construct the page for you.” Werner Vogels, Amazon.com CTO
    4. 4. INTERNAL SERVICES loads via 4 requests, total time10ms 10ms 4ms 1ms 9msNew For You Recommendations Ad Units Bestsellers
    5. 5. BUT WHY SOA?Isolation (encapsulation) rails application Product Authentication News Search DB
    6. 6. BUT WHY SOA? Isolationnews.designerpages.com designerpages.com Sinatra Rails Application Application DB DB
    7. 7. BUT WHY SOA? Benefits of Isolation•Robustness You can upgrade an underlying system without effecting clients•Scalability Each isolated system can scale independently•Organization Isolated systems are easy for teams to work on•Testing An encapsulated system is easier to test, single functionality•Agility You can make gradual improvements to smaller systems
    8. 8. BUT WHY SOA? And some more•Speed Parallel Requests•Interoperability Instant API•Reuse Client wrappers
    9. 9. BUT WHY SOA?And finally, a practical reason
    10. 10. THE RUBY SOA TOOLSET Sinatra - http://www.sinatrarb.com/ Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort:# myapp.rbrequire rubygemsrequire sinatraget / do Hello world!end#=> ruby myapp.rb#=> == Sinatra/1.2.1 has taken the stage on 4567 for development#=> >> Thin web server (v1.2.11 codename Bat-Shit Crazy)#=> >> Maximum connections set to 1024#=> >> Listening on 0.0.0.0:4567, CTRL+C to stop#=> 127.0.0.1 - - [06/Jul/2011 06:48:25] "GET / HTTP/1.1" 200 12 0.0038#=> curl http://localhost:4567#=> Hello world!
    11. 11. THE RUBY SOA TOOLSET httparty - a party in your http A simple module that turns a class into a basic HTTP wrapper.require rubygemsrequire httpartyclass Twitter include HTTParty base_uri search.twitter.com format :jsonendTwitter.get(/search.json, :query => {:q => "#rubyonrails"})[results].first[text]#=> "Who is going to NYC on Rails tonight? http://dsgnr.us/qrdh21 #rubyonrails"
    12. 12. NOW FOR SOME CODE...
    13. 13. THANKS!

    ×