55
Ruby and Rails, as secret weapon to build your service-oriented apps Friday, July 15, 2011

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

  • View
    4.053

  • Download
    1

Embed Size (px)

DESCRIPTION

 

Citation preview

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

Ruby and Rails, as secret weapon to build your

service-oriented apps

Friday, July 15, 2011

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

Felipe Talavera

@flype

Friday, July 15, 2011

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

- What’s a service?

- Peertransfer case

- A Typical rails application

- Advantages of the services approach

- Partitioning in services

- Ruby Toolbox

Agenda

Friday, July 15, 2011

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

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, ...

What is a service?

Friday, July 15, 2011

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

Service-oriented design

Friday, July 15, 2011

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

Service-oriented design is about creating systems that group functionality around logical function and business practices.

Friday, July 15, 2011

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

Services should be designed to be interoperable and reusable.

Friday, July 15, 2011

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

Splitting up parts into components that can be iterated on, improved, and fixed without

having to test and verify all the other components when an individual is updated

or added.

Friday, July 15, 2011

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

Usually entails a trade-off between complexity and iteration speed.

Friday, July 15, 2011

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

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

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

Friday, July 15, 2011

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

Friday, July 15, 2011

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

The Rails development style is all about quick iterations.

Friday, July 15, 2011

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

A Typical rails Application

Friday, July 15, 2011

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

A Typical rails Application

Friday, July 15, 2011

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

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

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

Service-oriented systems sacrifice iterationspeed for stability, reuse, and robustness.

Friday, July 15, 2011

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

Advantages of using services than a typical monolithic application:

Friday, July 15, 2011

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

Isolation...

Friday, July 15, 2011

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

Business Logic Isolation

Friday, July 15, 2011

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

Shared system isolation

Friday, July 15, 2011

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

Full Isolation

Friday, July 15, 2011

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

Testing in Isolation

Friday, July 15, 2011

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

Robustness

Friday, July 15, 2011

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

Scalability

Friday, July 15, 2011

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

Scalability on team and size

Friday, July 15, 2011

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

Reduces complexity in the codebase

Friday, July 15, 2011

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

Agility

Friday, July 15, 2011

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

Interoperability

Friday, July 15, 2011

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

Partitioning Functionality into

Separate Services:

Friday, July 15, 2011

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

Partitioning on iteration speed

Friday, July 15, 2011

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

Partitioning on Logical Function

Friday, July 15, 2011

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

Partition on Read/Write frequencies

Friday, July 15, 2011

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

Partition on Join Frequency

Friday, July 15, 2011

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

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

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

DownsidesReleases 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

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

Ruby Toolbox

Friday, July 15, 2011

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

JRuby

Friday, July 15, 2011

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

Rails

Friday, July 15, 2011

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

Sinatra

Friday, July 15, 2011

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

Goliath

Friday, July 15, 2011

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

Eventmachine

Friday, July 15, 2011

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

ActiveResource

Friday, July 15, 2011

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

HTTParty / Typhoeus

Friday, July 15, 2011

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

Foreman

Friday, July 15, 2011

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

Vagrant

Friday, July 15, 2011

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

AMQP

Friday, July 15, 2011

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

Conclusion

Friday, July 15, 2011

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

books

Enterprise Integration Patterns Designing,

Building, and Deploying Messaging Solutions

Friday, July 15, 2011

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

Questions?

Friday, July 15, 2011

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

We are hiring!

peertransfer.com

Friday, July 15, 2011

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

Friday, July 15, 2011

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

Friday, July 15, 2011

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

Friday, July 15, 2011

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

Thanks!

Friday, July 15, 2011