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

Service-oriented architecture

Service-oriented architecture

A modular style to software development is based on the use of distributed, loosely coupled, replaceable components.

Shalva Usubov

April 07, 2013
Tweet

More Decks by Shalva Usubov

Other Decks in Programming

Transcript

  1. Service-oriented
    architecture
    @H2Russia internal workshop

    View full-size slide

  2. http://geek-and-poke.com

    View full-size slide

  3. Monolithic Rails
    applications
    End user
    Domain logic
    Database

    View full-size slide

  4. Issues monolithic
    applications
    • Complexity
    • Hard deploy
    • Hard use new tools (DB, languages, etc.)
    • Scale team size
    • Changes are typically expensive

    View full-size slide

  5. What is it SOA?
    • A modular style to software development
    is based on the use of distributed, loosely
    coupled, replaceable components.
    • The fundamental concept of an SOA is that
    each component of the system is broken
    up into network-accessible services, which
    are integrated to make a functioning
    application.

    View full-size slide

  6. Rails application with
    multiple services
    End user
    High level domain logic
    Service 1
    Domain logic
    Database
    Service 2
    Domain logic
    Database
    Service N
    Domain logic
    Database

    View full-size slide

  7. Service-Oriented
    Design with Ruby

    View full-size slide

  8. SOA advantages over
    monolithic application
    • Isolation
    • Robustness
    • Scalability
    • Agility
    • Interoperability
    • Reuse

    View full-size slide

  9. Isolation
    • Object-oriented design
    • Business logic
    • System Isolation

    View full-size slide

  10. Robustness
    • Implementation can be changed without
    the API consumer’s knowledge.
    • Example: Changing libraries, database or
    even languages.

    View full-size slide

  11. Scalability
    • Easy to scale portions of application
    individually.
    • Can be handled on a case-by-case instead
    of requiring optimization of a single
    database for all cases.
    • Easier to scale team size.

    View full-size slide

  12. Agility
    • New services can be implemented outside
    the full architecture.
    • Service interface should be versioned.
    “/api/v1/users/:id”
    • Design includes the ability to run multiple
    versions of a service simultaneously.
    “/api/v1/users/:id” and “/api/v2/users/:id”

    View full-size slide

  13. Interoperability
    • Prevents being tied to a specific
    implementation.
    • Services ease interoperation with internal
    and external systems and with systems
    written in languages other than Ruby.

    View full-size slide

  14. Reuse
    • Service-oriented design enables reuse of
    components across multiple applications or
    clients.
    • If services are created for internal use, they
    can be exposed later to the public.

    View full-size slide

  15. Converting to Services
    • Partitioning on Iteration Speed
    • Partitioning on Logical Function
    • Partitioning on Read/Write Frequencies
    • Partitioning on Join Frequency

    View full-size slide

  16. What we need to learn
    • RESTful-Oriented
    Architecture
    • HTTP Methods
    • HTTP Caching
    • MIME types
    • I/O, Threading, and
    Parallelism
    • Amazon AWS
    • Create clients
    • Testing and Mocking
    Service Calls
    • Load Balancing
    • Security
    • Web Hooks
    • Chef
    • Typhoeus

    View full-size slide

  17. Load Balancing
    • Weighted Balance
    • Round-Robin
    • Least-Connections
    • URI-Based
    • Priority
    • Lowest Latency

    View full-size slide

  18. Caching
    • HTTP cache (cache-control, ETag, last-
    modified, expires)
    • Memcached
    • Squid and Varnish

    View full-size slide

  19. Debug
    • Efficiency 2.0 Ops Middleware - track
    distributed transactions across its Ruby-
    based service oriented architecture
    • Monitoring tool.

    View full-size slide

  20. Development
    • Use stub mode in clients in development
    environment.
    • Disable stub mode when develop service.

    View full-size slide

  21. Tests
    • Test client with service
    • Test application with stubbed service
    • Test the full stack

    View full-size slide