際際滷

際際滷Share a Scribd company logo
SOA AND RUBY ON RAILS
           a product case study for NYC on Rails




Avi Flombaum                                July 6th 2011
DesignerPages.com                           Infogroup
WHATS A SERVICE?
      a system that responds to HTTP Requests,
       usually to write, retrieve, or modify data.

    Service                                                       Client

Amazon 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]
WHATS A SERVICE?
      Services can be internal.

If you hit the Amazon.com gateway
page, the application calls more than
   100 services to collect data and
     construct the page for you.
 Werner Vogels, Amazon.com CTO
SOA on Rails
INTERNAL SERVICES



              loads via 4 requests, total time10ms
    10ms           4ms              1ms              9ms


New For You      Recommendations      Ad Units       Bestsellers
BUT WHY SOA?
Isolation (encapsulation)

       rails application

  Product         Authentication
   News
                    Search



             DB
BUT WHY SOA?
                         Isolation
news.designerpages.com               designerpages.com


       Sinatra                            Rails
      Application                       Application




         DB                                 DB
BUT WHY SOA?
                    Bene鍖ts 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
BUT WHY SOA?
                 And some more
Speed
   Parallel Requests
Interoperability
   Instant API
Reuse
   Client wrappers
BUT WHY SOA?
And 鍖nally, a practical reason
THE RUBY SOA TOOLSET
                Sinatra - http://www.sinatrarb.com/
 Sinatra is a DSL for quickly creating web applications in
 Ruby with minimal effort:
# myapp.rb
require 'rubygems'
require 'sinatra'

get '/' 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!
THE RUBY SOA TOOLSET
                     httparty - a party in your http
 A simple module that turns a class into a basic HTTP
 wrapper.
require 'rubygems'
require 'httparty'

class Twitter
  include HTTParty
  base_uri 'search.twitter.com'
  format :json
end

Twitter.get('/search.json', :query => {:q => "#rubyonrails"})
['results'].first['text']
#=> "Who is going to NYC on Rails tonight? http://dsgnr.us/qrdh21 #rubyonrails"
NOW FOR SOME CODE...
THANKS!

More Related Content

What's hot (20)

Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
jduff
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
jduff
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
George Wilson
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
MongoDB
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
Evgeniy Hinyuk
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Jeff Geerling
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
ICF CIRCUIT
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
Rami Sayar
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
Ryan Cuprak
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Craig Dickson
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
Perl in the Real World
Perl in the Real WorldPerl in the Real World
Perl in the Real World
OpusVL
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
Antonio Peric-Mazar
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruit
Bruce Werdschinski
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Sencha
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in Grails
Alfresco Software
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
Pravin Mishra
Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3Oak, the architecture of Apache Jackrabbit 3
Oak, the architecture of Apache Jackrabbit 3
Jukka Zitting
Riding rails for 10 years
Riding rails for 10 yearsRiding rails for 10 years
Riding rails for 10 years
jduff
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
jduff
Modern websites in 2020 and Joomla
Modern websites in 2020 and JoomlaModern websites in 2020 and Joomla
Modern websites in 2020 and Joomla
George Wilson
Apache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDBApache Jackrabbit Oak on MongoDB
Apache Jackrabbit Oak on MongoDB
MongoDB
Introduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy HinyukIntroduction to Rails by Evgeniy Hinyuk
Introduction to Rails by Evgeniy Hinyuk
Pivorak MeetUp
Lecture #5 Introduction to rails
Lecture #5 Introduction to railsLecture #5 Introduction to rails
Lecture #5 Introduction to rails
Evgeniy Hinyuk
Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]Java script nirvana in netbeans [con5679]
Java script nirvana in netbeans [con5679]
Ryan Cuprak
High Performance Drupal
High Performance DrupalHigh Performance Drupal
High Performance Drupal
Jeff Geerling
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
ICF CIRCUIT
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
Rami Sayar
Developing in the Cloud
Developing in the CloudDeveloping in the Cloud
Developing in the Cloud
Ryan Cuprak
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Craig Dickson
Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and Hybrid Mobile Development with Apache Cordova and
Hybrid Mobile Development with Apache Cordova and
Ryan Cuprak
Perl in the Real World
Perl in the Real WorldPerl in the Real World
Perl in the Real World
OpusVL
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
Antonio Peric-Mazar
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruit
Bruce Werdschinski
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
SenchaCon 2016: LinkRest - Modern RESTful API Framework for Ext JS Apps - Rou...
Sencha
PLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in GrailsPLAT-16 Using Enterprise Content in Grails
PLAT-16 Using Enterprise Content in Grails
Alfresco Software
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
Pravin Mishra

Similar to SOA on Rails (8)

Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Ian Massingham
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
Oracle Peoplesoft on AWS: A quick introduction
Oracle Peoplesoft on AWS: A quick introductionOracle Peoplesoft on AWS: A quick introduction
Oracle Peoplesoft on AWS: A quick introduction
Tom Laszewski
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
ecobold
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
Lecole Cole
Journey Towards Scaling Your Application to Million Users
Journey Towards Scaling Your Application to Million UsersJourney Towards Scaling Your Application to Million Users
Journey Towards Scaling Your Application to Million Users
Adrian Hornsby
Is serverless the new swiss cheese? ServerlessDays NYC 2018
Is serverless the new swiss cheese? ServerlessDays NYC 2018Is serverless the new swiss cheese? ServerlessDays NYC 2018
Is serverless the new swiss cheese? ServerlessDays NYC 2018
Chase Douglas
Escalando para sus primeros 10 millones de usuarios
Escalando para sus primeros 10 millones de usuariosEscalando para sus primeros 10 millones de usuarios
Escalando para sus primeros 10 millones de usuarios
Amazon Web Services LATAM
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit DublinScaling on AWS for the First 10 Million Users at Websummit Dublin
Scaling on AWS for the First 10 Million Users at Websummit Dublin
Ian Massingham
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds MeetupIntroducing to serverless computing and AWS lambda - Israel Clouds Meetup
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
Oracle Peoplesoft on AWS: A quick introduction
Oracle Peoplesoft on AWS: A quick introductionOracle Peoplesoft on AWS: A quick introduction
Oracle Peoplesoft on AWS: A quick introduction
Tom Laszewski
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
ecobold
How to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless EditionHow to Build a Big Data Application: Serverless Edition
How to Build a Big Data Application: Serverless Edition
Lecole Cole
Journey Towards Scaling Your Application to Million Users
Journey Towards Scaling Your Application to Million UsersJourney Towards Scaling Your Application to Million Users
Journey Towards Scaling Your Application to Million Users
Adrian Hornsby
Is serverless the new swiss cheese? ServerlessDays NYC 2018
Is serverless the new swiss cheese? ServerlessDays NYC 2018Is serverless the new swiss cheese? ServerlessDays NYC 2018
Is serverless the new swiss cheese? ServerlessDays NYC 2018
Chase Douglas
Escalando para sus primeros 10 millones de usuarios
Escalando para sus primeros 10 millones de usuariosEscalando para sus primeros 10 millones de usuarios
Escalando para sus primeros 10 millones de usuarios
Amazon Web Services LATAM

Recently uploaded (20)

Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and FeastSmarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Zilliz
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI
Commit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with KubescapeCommit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with Kubescape
Alfredo Garc鱈a Lavilla
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio WebUiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
DianaGray10
Recruiting Tech: A Look at Why AI is Actually OG
Recruiting Tech: A Look at Why AI is Actually OGRecruiting Tech: A Look at Why AI is Actually OG
Recruiting Tech: A Look at Why AI is Actually OG
Matt Charney
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
David Brossard
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
Ivan Tang
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-WorldAll-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
Safe Software
Why Outsource Accounting to India A Smart Business Move!.pdf
Why Outsource Accounting to India A Smart Business Move!.pdfWhy Outsource Accounting to India A Smart Business Move!.pdf
Why Outsource Accounting to India A Smart Business Move!.pdf
anjelinajones6811
CIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper ColinCIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper Colin
Jasper Colin
How Telemedicine App Development is Revolutionizing Virtual Care.pptx
How Telemedicine App Development is Revolutionizing Virtual Care.pptxHow Telemedicine App Development is Revolutionizing Virtual Care.pptx
How Telemedicine App Development is Revolutionizing Virtual Care.pptx
Dash Technologies Inc
The Road to SAP S4HANA Cloud with SAP Activate.pptx
The Road to SAP S4HANA Cloud with SAP Activate.pptxThe Road to SAP S4HANA Cloud with SAP Activate.pptx
The Road to SAP S4HANA Cloud with SAP Activate.pptx
zsbaranyai
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
jackalen173
Least Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role PermissionsLeast Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role Permissions
Chris Wahl
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly MeetupLeadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
GDG Kathmandu
Threat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community DayThreat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community Day
Teri Radichel
Benefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle CloudBenefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle Cloud
AstuteBusiness
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and FeastSmarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Zilliz
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI: How Much Does an XXX AI Porn Generator Cost in 2025
Sugarlab AI
Commit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with KubescapeCommit Conf 2025 Bitnami Charts with Kubescape
Commit Conf 2025 Bitnami Charts with Kubescape
Alfredo Garc鱈a Lavilla
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio WebUiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
UiPath NY AI Series: Session 4: UiPath AutoPilot for Developers using Studio Web
DianaGray10
Recruiting Tech: A Look at Why AI is Actually OG
Recruiting Tech: A Look at Why AI is Actually OGRecruiting Tech: A Look at Why AI is Actually OG
Recruiting Tech: A Look at Why AI is Actually OG
Matt Charney
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
AuthZEN The OpenID Connect of Authorization - Gartner IAM EMEA 2025
David Brossard
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...Automating Behavior-Driven Development: Boosting Productivity with Template-D...
Automating Behavior-Driven Development: Boosting Productivity with Template-D...
DOCOMO Innovations, Inc.
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
Ivan Tang
ScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 EdinburghScotSecure Cyber Security Summit 2025 Edinburgh
ScotSecure Cyber Security Summit 2025 Edinburgh
Ray Bugg
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-WorldAll-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
All-Data, Any-AI Integration: FME & Amazon Bedrock in the Real-World
Safe Software
Why Outsource Accounting to India A Smart Business Move!.pdf
Why Outsource Accounting to India A Smart Business Move!.pdfWhy Outsource Accounting to India A Smart Business Move!.pdf
Why Outsource Accounting to India A Smart Business Move!.pdf
anjelinajones6811
CIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper ColinCIOs Speak Out - A Research Series by Jasper Colin
CIOs Speak Out - A Research Series by Jasper Colin
Jasper Colin
How Telemedicine App Development is Revolutionizing Virtual Care.pptx
How Telemedicine App Development is Revolutionizing Virtual Care.pptxHow Telemedicine App Development is Revolutionizing Virtual Care.pptx
How Telemedicine App Development is Revolutionizing Virtual Care.pptx
Dash Technologies Inc
The Road to SAP S4HANA Cloud with SAP Activate.pptx
The Road to SAP S4HANA Cloud with SAP Activate.pptxThe Road to SAP S4HANA Cloud with SAP Activate.pptx
The Road to SAP S4HANA Cloud with SAP Activate.pptx
zsbaranyai
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
jackalen173
Least Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role PermissionsLeast Privilege AWS IAM Role Permissions
Least Privilege AWS IAM Role Permissions
Chris Wahl
Artificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examplesArtificial Neural Networks, basics, its variations and examples
Artificial Neural Networks, basics, its variations and examples
anandsimple
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly MeetupLeadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
GDG Kathmandu
Threat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community DayThreat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community Day
Teri Radichel
Benefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle CloudBenefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle Cloud
AstuteBusiness

SOA on Rails

  • 1. SOA AND RUBY ON RAILS a product case study for NYC on Rails Avi Flombaum July 6th 2011 DesignerPages.com Infogroup
  • 2. WHATS A SERVICE? a system that responds to HTTP Requests, usually to write, retrieve, or modify data. Service Client Amazon 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. WHATS A SERVICE? Services can be internal. If you hit the Amazon.com gateway page, the application calls more than 100 services to collect data and construct the page for you. Werner Vogels, Amazon.com CTO
  • 5. INTERNAL SERVICES loads via 4 requests, total time10ms 10ms 4ms 1ms 9ms New For You Recommendations Ad Units Bestsellers
  • 6. BUT WHY SOA? Isolation (encapsulation) rails application Product Authentication News Search DB
  • 7. BUT WHY SOA? Isolation news.designerpages.com designerpages.com Sinatra Rails Application Application DB DB
  • 8. BUT WHY SOA? Bene鍖ts 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
  • 9. BUT WHY SOA? And some more Speed Parallel Requests Interoperability Instant API Reuse Client wrappers
  • 10. BUT WHY SOA? And 鍖nally, a practical reason
  • 11. THE RUBY SOA TOOLSET Sinatra - http://www.sinatrarb.com/ Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort: # myapp.rb require 'rubygems' require 'sinatra' get '/' 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!
  • 12. THE RUBY SOA TOOLSET httparty - a party in your http A simple module that turns a class into a basic HTTP wrapper. require 'rubygems' require 'httparty' class Twitter include HTTParty base_uri 'search.twitter.com' format :json end Twitter.get('/search.json', :query => {:q => "#rubyonrails"}) ['results'].first['text'] #=> "Who is going to NYC on Rails tonight? http://dsgnr.us/qrdh21 #rubyonrails"
  • 13. NOW FOR SOME CODE...

Editor's Notes