I Love APIs 2015
Darby Frey, Belly
https://www.bellycard.com/
There are a lot of great tools for building APIs in Ruby, however as your business grows and requirements change those tools don't always get the job done. Our team at Belly learned the hard way as we grew from a monolith to a SOA. The good news is, we streamlined our development workflow and empowered our team to react to product changes quickly and confidently in the process. In this talk, Darby covered why Belly chose to build an API layer on top of their existing SOA and the wins achieved in doing so. More specifically, Darby discusses Belly's learning, the challenging parts, and some open source tools we created to help us along the way. A simple product change doesn't need to lead to days of development and refactoring, or the risk of breaking exiting clients.
19. Monolith
● Scaling problems
● Slow to iterate (1+ hour builds, tight coupling)
● One API for everything (lots of client concerns)
20.
21. Bellywall
● Rails app proxy to SOA - SOA scales better
● Authentication and Authorization layer (removed some complexity)
● Nearly direct access to services
22. Bellywall
● Still a single API
● Lots of requests (not mobile friendly)
● Clever hacks
● Little visibility
43. Unit / Integration Testing
● apigee-mock
● Inspired by Sparrow.js
● Provides a basic interface to the Apigee JS
environment
● Allows us to use nock to intercept and stub
service requests
● https://github.com/darbyfrey/apigee-mock
44.
45. Command Line Tool
● apigee_cli
● Wraps apigeetool for deployment
● Provides a CLI interface to configs and
resource files
● https://github.com/bellycard/apigee_cli
46. Command Line Tool
● Uses .apigeerc for credentials
● View and update configuration variables
● View, change and remove resource files
47. End To End Testing
● clumsy
● Uses ngrok
● Allows for testing a proxy’s output instead
of it’s response
● https://github.com/darbyfrey/clumsy
48.
49. End To End Testing
1. Start a test by sending a request to a proxy
2. That request hits the proxy and gets
proxied to the ngrok tunnel
3. The ngrok tunnel routes the request back to
the same process that initiated the request
4. That process can make assertions based on
that inbound request or send back stub
data
PROXY
TEST
NGROK