![Page 1: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/1.jpg)
OstrichBrandon Beck, Engineering Lead
![Page 2: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/2.jpg)
Why SOA?
![Page 3: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/3.jpg)
What is a Service Oriented Architecture?
http://en.wikipedia.org/wiki/File:SOA_Metamodel.svg
![Page 4: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/4.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/5.jpg)
● Decoupled software
● Decoupled teams
● Decoupled deployment
Why SOA?
![Page 6: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/6.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/7.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/8.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/9.jpg)
Best Practices
![Page 10: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/10.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/11.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/12.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/13.jpg)
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)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/14.jpg)
Examples
![Page 15: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/15.jpg)
CalculatorService
![Page 16: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/16.jpg)
Retry Loops
![Page 17: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/17.jpg)
Service Factory
![Page 18: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/18.jpg)
Client Library
![Page 19: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/19.jpg)
Other Cool Things
● Dynamic Proxies
● Yammer Metrics
● Consistent Hashing
● Configurable EndPoint Caching/Pooling
● Async Operations
![Page 20: Austin Scales - Ostrich (Lightweight SOA framework)](https://reader033.vdocuments.site/reader033/viewer/2022060115/5578e5dbd8b42a5c5c8b49c0/html5/thumbnails/20.jpg)
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>