austin scales - ostrich (lightweight soa framework)

20
Ostrich Brandon Beck, Engineering Lead

Upload: bazaarvoiceengineering

Post on 11-Jun-2015

268 views

Category:

Technology


0 download

DESCRIPTION

Brandon Beck talks about Ostrich, Bazaarvoice's service oriented architecture library that enables easy deployment and maintenance of loosely coupled services in the cloud.

TRANSCRIPT

Page 1: Austin Scales - Ostrich (Lightweight SOA framework)

OstrichBrandon Beck, Engineering Lead

Page 2: Austin Scales - Ostrich (Lightweight SOA framework)

Why SOA?

Page 3: Austin Scales - Ostrich (Lightweight SOA framework)

What is a Service Oriented Architecture?

http://en.wikipedia.org/wiki/File:SOA_Metamodel.svg

Page 4: Austin Scales - Ostrich (Lightweight SOA framework)

What is a Service Oriented Architecture?

SOA separates functions into distinct units, or services, which developers make accessible over a network in order to allow users to combine and reuse them in the production of applications.

These services and their corresponding consumers communicate with each other by passing data in a well-defined, shared format, or by coordinating an activity between two or more services.

Page 5: Austin Scales - Ostrich (Lightweight SOA framework)

● Decoupled software

● Decoupled teams

● Decoupled deployment

Why SOA?

Page 6: Austin Scales - Ostrich (Lightweight SOA framework)

Ostrich

● Bazaarvoice authored library to help build service oriented architectures

● Lots of services at BV using it in production

● JVM based

● Open source

Page 7: Austin Scales - Ostrich (Lightweight SOA framework)

Use Cases

● Automatically adapt to maintenance and outages

● Minimize manual configuration needed to interact with a service

● Focus on server to server communication within a single data center

Page 8: Austin Scales - Ostrich (Lightweight SOA framework)

Concepts

● Registry/Discovery○ Who is out there? How do I tell others about me?

● Load Balancing○ Which one should I use?

● Error Recovery○ I really did need that answer...

● Client Libraries○ How do we communicate?

Page 9: Austin Scales - Ostrich (Lightweight SOA framework)

Best Practices

Page 10: Austin Scales - Ostrich (Lightweight SOA framework)

Registration and Discovery

● Use a live, automatically updating view of the world

● Including updates when processes crash

● We use ZooKeeper ephemeral nodes for this

Page 11: Austin Scales - Ostrich (Lightweight SOA framework)

Error Handling and Retries

● Wrap every call to a service in an error handling/retry loop

● Expect failures to happen and distinguish between transient failures and systemic ones. Make all operations idempotent!!!

● In Ostrich we made it so that all remote operations require error handling

Page 12: Austin Scales - Ostrich (Lightweight SOA framework)

Health Checks

● Require services to be able to make a declaration of whether or not they're healthy

● Otherwise after a failure you have no idea when you can start using a previously unhealthy service again

● Ostrich requires that all service providers implement an "is healthy" method

Page 13: Austin Scales - Ostrich (Lightweight SOA framework)

Client Libraries

● Make your service authors also provide a client library for communicating with their service

● Produces better quality and standardized integrations

Page 14: Austin Scales - Ostrich (Lightweight SOA framework)

Examples

Page 15: Austin Scales - Ostrich (Lightweight SOA framework)

CalculatorService

Page 16: Austin Scales - Ostrich (Lightweight SOA framework)

Retry Loops

Page 17: Austin Scales - Ostrich (Lightweight SOA framework)

Service Factory

Page 18: Austin Scales - Ostrich (Lightweight SOA framework)

Client Library

Page 19: Austin Scales - Ostrich (Lightweight SOA framework)

Other Cool Things

● Dynamic Proxies

● Yammer Metrics

● Consistent Hashing

● Configurable EndPoint Caching/Pooling

● Async Operations

Page 20: Austin Scales - Ostrich (Lightweight SOA framework)

Questions?

● GitHub project pagehttp://github.com/bazaarvoice/ostrich

● Maven artifacts<dependency> <groupId>com.bazaarvoice.ostrich</groupId> <artifactId>ostrich-core</artifactId> <version>1.5.0</version></dependency>

[email protected]