Download - API Strategies in the Enterprise

Transcript
Page 1: API Strategies in the Enterprise

Ross Mason @rossmason

Strategies for

APIs in the

Enterprise

Page 2: API Strategies in the Enterprise

About me

• Created the Mule project• Founded MuleSoft• API eye for the SOAP guy• Thingologist (thingology.org)

@rossmason

Page 3: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

Why would an enterprise company buy ProgrammableWeb.com?

+ = ?

@rossmason

Page 4: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

Web APIs are the

Playbook for the

enterprise

@rossmason

Page 5: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

…or 13,000 ideas

to steal adapt

@rossmason

Page 6: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.#MuleSoftWebinar

RESTful APIs

@rossmason

Page 7: API Strategies in the Enterprise

Open APIs are the tip of the iceberg

13,000

@rossmason

Page 8: API Strategies in the Enterprise

Open APIs are the tip of the iceberg

13,000

1,000,000sof APIsin the

enterprise

@rossmason

Page 9: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

Enterprise APIs = API delivery at scale

- 3Cs: Clean, Clear, Consistent- Across teams, across orgs- Rapid creation, iteration, lifecycle

management

@rossmason

Page 10: API Strategies in the Enterprise

SOA

API

@rossmason

Page 11: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

Enterprise SOA

- 3Cs: Clean, Clear, Consistent- Across teams, across orgs- Rapid creation, iteration, lifecycle

management

@rossmason

Page 12: API Strategies in the Enterprise

APIs in the Enterprise

Your APIs

Developer

Customers

Partners

AffiliatesMobile

Internal projects

Your Assets

@rossmason

Page 13: API Strategies in the Enterprise

What we see in the Enterprise

Your APIs

Developer

Customers

Partners

AffiliatesMobile

Internal projects

Your Assets

@rossmason

Page 14: API Strategies in the Enterprise

API types and business opportunities

Source: Forrester, Establish your API design, June 2013

Page 15: API Strategies in the Enterprise

@rossmason

Page 16: API Strategies in the Enterprise

APX: Between Form and Function

APX

Application Programming eXperience

@rossmason

Page 17: API Strategies in the Enterprise

• Design for them• Iterate quickly• Model cleanly and consistently • Engage

Delight your API consumers

@rossmason

Page 18: API Strategies in the Enterprise

• Orchestrating service provider…

• …or core single-purpose service?

• Back end…

• …or front end?

• Straight-through proxy…

• …or new façade?

What is your value add?consumer devs

@rossmason

Page 19: API Strategies in the Enterprise

Think APX!

Don't expose dirty laundry

users

products

ordersinvoices

Craft it for your users: what will they love?

• This is a long-lived interface, • ladies and gentlemen

@rossmason

Page 20: API Strategies in the Enterprise

my focus today• SOAP and WSDL over HTTP• REST: HTTP taken seriously

• e.g. GET /users a page/data representing users• Mix & match:

• Google protocol buffers over HTTP• <something> over websockets

•API facades:• the RESTmullet (REST in front, SOAP in back)• mobile REST/GPB/MQTT on top of SOA

Forms of APIs

@rossmason

Page 21: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

The 3Cs in Action(Clean, Clear, Consistent)

@rossmason

Page 22: API Strategies in the Enterprise

• Nouns: resources• Carefully consider your domain objects• Query params are refinements on resources• /users• /users?zip=94301&subscribed=true• /users/me• /users/5638• /users/5638/books• /users/5638/books/20467• /books• /books/20467

Practical REST, be Clear

@rossmason

Page 23: API Strategies in the Enterprise

• Verbs: methods

Practical REST, be Clear and Consistent

GET retrieve (idempotent!)

POST create in container

PUT update – replace (usually)

PATCH update – partial

DELETE remove

HEAD GET w/o body (headers)

OPTIONS metadata, e.g. methods

Status codes• Standardized• Use them!

• Don't return 200unless it's really OK

• No surprises please

Headers• Standardized• Use them!

@rossmason

Page 24: API Strategies in the Enterprise

•We like RAML: RESTful API Modeling Language

• Clean, clear, powerful• 100% natural & organic• Open, vendor-neutral• Practical• Pattern-based design

is built in

How to describe your specific API?

@rossmason

Page 25: API Strategies in the Enterprise

Clean, align to a logical model: users & groups

@rossmason

Page 26: API Strategies in the Enterprise

Clean, align to a logical model: eCommerce

@rossmason

Page 27: API Strategies in the Enterprise

collections and members

Consistent patterns: resource types

"special" id's

one-off resources

read-only resources

@rossmason

Page 28: API Strategies in the Enterprise

Consistent patterns: method traits

@rossmason

Page 29: API Strategies in the Enterprise

Be Clear: body schemas

or just use good ol' form data:

XML schema

JSON schema

examples@rossmason

Page 30: API Strategies in the Enterprise

Be Clear: security schemesusername/password; cleartext or use digest

end user allows app to access their data

better to put token in header, not query

the OAuth multi-step dance

@rossmason

Page 31: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

Enterprise APIs

- 3Cs: Clean, Clear, Consistent (APX)- Across teams, across orgs (RAML.org)- Rapid creation, iteration, lifecycle

management (APIhub.com)

@rossmason

Page 32: API Strategies in the Enterprise

Good APIs aren't trivial

But with the proper approach…

…they can be your home-court advantage"First one home wins?"

"Deal"

"#$*%!"

@rossmason

Page 33: API Strategies in the Enterprise

All contents Copyright © 2013, MuleSoft Inc.

Thank you

Twitter: @rossmasonCompany: http://mulesoft.com