ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Ruby and Rails,
              as secret weapon to build your
                  service-oriented apps



Friday, July 15, 2011
Felipe Talavera
                            @?ype




Friday, July 15, 2011
Agenda
        - What¡¯s a service?
        - Peertransfer case
        - A Typical rails application
        - Advantages of the services approach
        - Partitioning in services
        - Ruby Toolbox

Friday, July 15, 2011
What is a service?

        	 System that respond to HTTP requests:
        	 	 Twitter API, Amazon S3 API, New York Times API

        	 System that provides functionality through a standard interface:
        	 	 	 MySQL, Memcached, RabbitMQ, ...




Friday, July 15, 2011
Service-oriented design



Friday, July 15, 2011
Service-oriented design is about creating
                systems that group functionality around
                logical function and business practices.




Friday, July 15, 2011
Services should be designed to be
                           interoperable and reusable.




Friday, July 15, 2011
Splitting up parts into components that can
          be iterated on, improved, and ?xed without
              having to test and verify all the other
          components when an individual is updated
                            or added.




Friday, July 15, 2011
Usually entails a trade-off between
                         complexity and iteration speed.




Friday, July 15, 2011
Amazon AWS
            Every piece of the AWS architecture is exposed as a web
            service, low-level system components exposed through
                                 a services layer.
                        S3, SQS, SimpleDB, CloudFront, EC2




Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
The Rails development style is all
                             about quick iterations.




Friday, July 15, 2011
A Typical rails Application




Friday, July 15, 2011
A Typical rails Application




Friday, July 15, 2011
The key to pairing Rails applications
        with services is to use Rails for its strengths
            and switch over to services when a
             more stable approach is required




Friday, July 15, 2011
Service-oriented systems sacri?ce iteration
           speed for stability, reuse, and robustness.




Friday, July 15, 2011
Advantages of using services than
                         a typical monolithic application:




Friday, July 15, 2011
Isolation...


Friday, July 15, 2011
Business Logic
                           Isolation


Friday, July 15, 2011
Shared system
                           isolation


Friday, July 15, 2011
Full Isolation


Friday, July 15, 2011
Testing in Isolation


Friday, July 15, 2011
Robustness


Friday, July 15, 2011
Scalability


Friday, July 15, 2011
Scalability on team
                             and size


Friday, July 15, 2011
Reduces complexity
                 in the codebase


Friday, July 15, 2011
Agility


Friday, July 15, 2011
Interoperability


Friday, July 15, 2011
Partitioning
                         Functionality into
                        Separate Services:

Friday, July 15, 2011
Partitioning on
                        iteration speed


Friday, July 15, 2011
Partitioning on
                        Logical Function


Friday, July 15, 2011
Partition on Read/Write
           frequencies

Friday, July 15, 2011
Partition on Join
                          Frequency


Friday, July 15, 2011
Versioning

                        ? http://localhost:3000/api/v1/users/1
                        ? http://localhost:3000/users/1?version=1
                        ? http://localhost:3000/api/v2/users/1




Friday, July 15, 2011
Downsides
                           Releases dependencies nightmare
                              Smoke test suit mandatory
                        More moving parts and integration points
                              Trivial rails stuff gets harder
                                Failure tolerance is hard




Friday, July 15, 2011
Ruby Toolbox



Friday, July 15, 2011
JRuby



Friday, July 15, 2011
Rails



Friday, July 15, 2011
Sinatra



Friday, July 15, 2011
Goliath



Friday, July 15, 2011
Eventmachine



Friday, July 15, 2011
ActiveResource



Friday, July 15, 2011
HTTParty / Typhoeus



Friday, July 15, 2011
Foreman



Friday, July 15, 2011
Vagrant



Friday, July 15, 2011
AMQP



Friday, July 15, 2011
Conclusion


Friday, July 15, 2011
books

                           Enterprise Integration
                             Patterns Designing,
                           Building, and Deploying
                            Messaging Solutions




Friday, July 15, 2011
Questions?


Friday, July 15, 2011
We are hiring!

                         peertransfer.com
Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
Friday, July 15, 2011
Thanks!


Friday, July 15, 2011

More Related Content

Ruby and Rails, as secret weapon to build your service-oriented apps