api design principles for accelerated development

27
For Accelerated Development API Design Principles Jonathan LeBlanc Head of Developer Evangelism (North America) Github: http://github.com/jcleblanc Slides: http://slideshare.net/jcleblanc Twitter: @jcleblanc

Upload: jonathan-leblanc

Post on 28-Jan-2015

105 views

Category:

Technology


1 download

DESCRIPTION

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

TRANSCRIPT

Page 1: API Design Principles for Accelerated Development

For Accelerated Development

API Design Principles

Jonathan LeBlancHead of Developer Evangelism (North

America)Github: http://github.com/jcleblanc

Slides: http://slideshare.net/jcleblancTwitter: @jcleblanc

Page 2: API Design Principles for Accelerated Development

The Exploration of API Design

Blank Slate Constraints

Page 3: API Design Principles for Accelerated Development

Building APIs for Developers

Page 4: API Design Principles for Accelerated Development

The Tradeoff Decision

Page 5: API Design Principles for Accelerated Development

Developer efficiency task 1

Lowering perceived latency for developers

Lower Perceived Latency

Page 6: API Design Principles for Accelerated Development

What’s the Tradeoff?

System Layering

Result Caching

Page 7: API Design Principles for Accelerated Development

Layering the System

Encapsulates legacy systems

Simplified components

Better load balancing abilities

Systems can evolve independantly

Page 8: API Design Principles for Accelerated Development

Separation of Concerns

Page 9: API Design Principles for Accelerated Development

Stateless System Latency Issues

Data Duplication

A + B

A + C

Page 10: API Design Principles for Accelerated Development

Caching for Latency Reduction

Page 11: API Design Principles for Accelerated Development

Developer efficiency task 2

Use HTTP properly – standard request and response types

Use HTTP Properly

Page 12: API Design Principles for Accelerated Development

What’s the Tradeoff?

Page 13: API Design Principles for Accelerated Development

Requests and Responses

GET / PUT / POST / DELETE have specific actions

Proper status codes and error responses

Page 14: API Design Principles for Accelerated Development

Don’t do This{"error": "error 10008"}

Do ThisHTTP/1.1 400 Bad RequestContent-Length: 35

{"message":"Problems parsing JSON"}

Descriptive Messaging

Page 15: API Design Principles for Accelerated Development

Developer efficiency task 3

Building in automation – using HATEOAS

Build in Automation

Page 16: API Design Principles for Accelerated Development

What’s the Tradeoff?

Payload Size Code Length

Page 17: API Design Principles for Accelerated Development

How we Normally Consume APIs

Page 18: API Design Principles for Accelerated Development

Using HATEOAS to Automate

Page 19: API Design Principles for Accelerated Development

"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" }]

Page 20: API Design Principles for Accelerated Development

Developer efficiency task 2Secure Data Resources

Page 21: API Design Principles for Accelerated Development

What’s the Tradeoff?

Security Usability

Page 22: API Design Principles for Accelerated Development

Some Security Models

Proprietary Solution

Basic Authentication

OAuth 1.0a

OAuth 2 / OpenID Connect

Page 23: API Design Principles for Accelerated Development

Developer efficiency task 4

Offload complexity to the implementing provider

Offload Complexity

Page 24: API Design Principles for Accelerated Development

The Complexities

Authentication / Authorization

Legacy API support

Working between versioning

API changes that break implementations

Reduction in latency

Page 25: API Design Principles for Accelerated Development

API architecture is all about tradeoffs

You are not making a perfect system, you are making a perfect system for your developers

Bringing it all Together

Page 26: API Design Principles for Accelerated Development
Page 27: API Design Principles for Accelerated Development

http://bit.ly/api_design_for_devs

Thank You!

Jonathan LeBlancHead of Developer Evangelism (North

America)Github: http://github.com/jcleblanc

Slides: http://slideshare.net/jcleblancTwitter: @jcleblanc