270 likes | 315 Views
One of the largest issues in API architecture development is that the task is often driven by the pragmatic indoctrination of a specification into a product rather than designing around the speed and ease of development, usually due to a separation between the engineering teams and their core developer user base. Extending upon the ideas of API design around developer accelerated development delivered in the PayPal keynote, we will take a deeper look into some of the great techniques delivered to us through the RESTful specification, applying them to developer API consumption practices with the intention of creating efficient best practices for rapid development. Within this talk we will explore what we have learned through reconstructing our API backbone at PayPal for our developer community, including: - API automation practices for code reduction and application longevity - Open security standards that promote developer integration ease and maintain strict security practices - RESTful API architecture best practices for developer centric accelerated development
E N D
API Design Principles For Accelerated Development Jonathan LeBlanc Head of Developer Evangelism (North America) Github: http://github.com/jcleblanc Slides: http://slideshare.net/jcleblanc Twitter: @jcleblanc
The Exploration of API Design Blank Slate Constraints
Developer efficiency task 1 Lower Perceived Latency Lowering perceived latency for developers
What’s the Tradeoff? System Layering Result Caching
Layering the System Encapsulates legacy systems Simplified components Better load balancing abilities Systems can evolve independantly
Stateless System Latency Issues A + B A + C Data Duplication
Developer efficiency task 2 Use HTTP Properly Use HTTP properly – standard request and response types
Requests and Responses GET / PUT / POST / DELETE have specific actions Proper status codes and error responses
Descriptive Messaging Don’t do This {"error": "error 10008"} Do This HTTP/1.1 400 Bad Request Content-Length: 35 {"message":"Problems parsing JSON"}
Developer efficiency task 3 Building in automation – using HATEOAS Build in Automation
What’s the Tradeoff? Payload Size Code Length
"links": [ { "href":"https://api.sandbox.paypal.com/v1/payments/ authorization/6H149011U8307001M", "rel":"self", "method":"GET" },{ "href":"https://api.sandbox.paypal.com/v1/payments/ authorization/6H149011U8307001M/capture", "rel":"capture", "method":"POST" },{ "href":"https://api.sandbox.paypal.com/v1/payments/ authorization/6H149011U8307001M/void", "rel":"void", "method":"POST" } ]
Developer efficiency task 2 Secure Data Resources
What’s the Tradeoff? Security Usability
Some Security Models Proprietary Solution Basic Authentication OAuth 1.0a OAuth 2 / OpenID Connect
Developer efficiency task 4 Offload complexity to the implementing provider Offload Complexity
The Complexities Authentication / Authorization Legacy API support Working between versioning API changes that break implementations Reduction in latency
Bringing it all Together API architecture is all about tradeoffs You are not making a perfect system, you are making a perfect system for your developers
Thank You! http://bit.ly/api_design_for_devs Jonathan LeBlanc Head of Developer Evangelism (North America) Github: http://github.com/jcleblanc Slides: http://slideshare.net/jcleblanc Twitter: @jcleblanc