Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

75
Web APIs - Infrastructure for the (Intelligent) Programmable Web Steven Willmott, 3scale networks

description

A couple of weeks I had the pleasure of visiting the CETINA Research Institute at URJC (http://www.cetinia.urjc.es/) in Madrid for an Invited Talk. I pulled together some thoughts from 3scale and some R&D worked I've been involved in to muse about how the web will evolve. Fun to be there - thanks to CETINA and Sascha in particular for the invite!

Transcript of Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Page 1: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web APIs - Infrastructure for the (Intelligent) Programmable WebSteven Willmott, 3scale networks

Page 2: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Services will fundamentally change the way the Internet works within the next 5-7 years

Page 3: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Services will fundamentally change the way the Internet works within the next 5-7 years

(and much of that change will happen in the next 2-3)

Page 4: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Change in what way?

Web applications will be totally different

The way content is generated, manipulated and consumed will be totally different

Revenue streams and business models will be totally different

Page 5: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

“The adoption of Amazon's Web services is currently

driving more network activity than everything

Amazon does through their traditional Web sites.” Jeff Bar (Amazon evangelist) / Dion Hinchcliffe (Journalist)

“60% of all listings on eBay are added via their

API’s – and eBay services over 6 billion API calls

per month”

John Musser (Programmable Web)

“The API which has easily 10 times more traffic than

the website, has been really very important to us.”

Biz Stone (co-founder, Twitter)

Page 6: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Social Network Apps

Page 7: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Social Network Apps

Image: Steve O’Hear / ZDNET

Page 8: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Social Network Apps

Facebook

OpenSocial

Platform API + Backend

Rapid growth

Image: Steve O’Hear / ZDNET

Page 9: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Mobile (& Desktop) Widgets

Page 10: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Mobile (& Desktop) Widgets

Image: NinjaTech4u / FLICKR

Page 11: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Mobile (& Desktop) Widgets

Small Application

Not browsers

Arbitrary Data

Synchronous or Asynchronous

Image: NinjaTech4u / FLICKR

Page 12: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Data Streams

Page 13: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Data Streams

Page 14: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Data Streams

Example: Xignite

50+ data streams of financial information

All by Web Service / API

Page 15: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

How many services?

Page 16: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

How many services?

Page 17: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

How many services?

programmableweb.com

1500+ APIS

4000+ Mashups

70-80% REST APIs

Growing Fast

Hugely Diverse

Page 18: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

What Changed?

SOAP gave way to REST

APIs became easy to build

APIs became easy(ier) to use

APIs became incredibly useful

Page 19: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

What Changed?

SOAP gave way to REST

APIs became easy to build

APIs became easy(ier) to use

APIs became incredibly useful

Image: Peta M / Flickr

Page 20: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

What more is changing?

Javascript is accelerating

HTML5 is coming

Widgets are taking off

Partnering is getting serious

Page 21: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Why 5-7 years?

Several generations of technology

Today’s leading Web Services will have had transformative effects

Almost all segment followers will have launched Web Services

Internet experience will have caught up for users

No time for 3 or 4 complex 5 year R&DProjects!

Page 22: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Technology

Page 23: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Services (APIS...)

Programmable Web:

SOAP Web Services

REST Web Services

Plain HTML Forms

They can all be manipulated programatically to produce an effect

Page 24: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

RESTfull Web Services

Resources

Resource Identifiers (URIs)

Representations

Operators

Response Codes

REST powers the (new) programmable web

Page 25: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Operators

Page 26: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

OperatorsGETGet Information about a resource

POSTCreate : create new elements in a resource

Update : modify a resource

PUTCreate : Create a new resource

Update : Modify a resource

DELETERemove a resource

Page 27: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

OperatorsGETGet Information about a resource

POSTCreate : create new elements in a resource

Update : modify a resource

PUTCreate : Create a new resource

Update : Modify a resource

DELETERemove a resource

Manipulating Data Objects

Page 28: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

REST

Page 29: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

REST

70-80% of current Web APIs

Very Wide Range of Applications

SOAP Seems unlikely to catch up any time soon

Page 30: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

REST

70-80% of current Web APIs

Very Wide Range of Applications

SOAP Seems unlikely to catch up any time soon

Great Rest Presentation: Alex Puig / Softonic / Slidesharehttp://www.slideshare.net/apuig75/desarrollando-un-api-con-rest

Page 31: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

REST

70-80% of current Web APIs

Very Wide Range of Applications

SOAP Seems unlikely to catch up any time soon

Great Rest Presentation: Alex Puig / Softonic / Slidesharehttp://www.slideshare.net/apuig75/desarrollando-un-api-con-rest

An Example:

Page 32: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)
Page 33: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Example APIs: Twitter

Microblogging Service

45-50 Million users worldwide

10x traffic on their API v’s Web Page

Large numbers of client and partner applications

REST API

Page 35: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

What happened to...

Governance?

Semantics?

WSDL?

Trust??

Page 36: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Intelligence in the Programmable Web

Page 37: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

Page 38: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

User

Page 39: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

UserMore time on Well

Known Properties

Page 40: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

UserMore time on Well

Known Properties

More new ways to access content

sources

Page 41: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

UserMore time on Well

Known Properties

More new ways to access content

sources

APIs to feedwidgets

Page 42: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

UserMore time on Well

Known Properties

More new ways to access content

sources

APIs to feedwidgets

APIs to feedplatforms

Page 43: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Two trends

UserMore time on Well

Known Properties

More new ways to access content

sources

APIs to feedwidgets

APIs to feedplatforms

Web Applications will get inc. interconnected

Page 44: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

The rules change

The Web Page is no longer King

Service to Service relationships are Business to Business relationships

People care about wether Web Services work

People care that applications built on Web Services work

Page 45: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Key Concepts

Agency: the components you depend on are not owned/operated by you, they are beyond your control.

Contracts: individual interactions need to be mediated by expectations, agreements and (potentially) consequences.

Norms: relationships are long running and require defaults, frameworks and other constructs to make them efficient.

Page 46: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

IST FP6 Project: Contract

Full Credit - Javier Vazquez, UPCand others from http://www.ist-contract.org/

(an experiment in how notions of contracts and autonomy can power new service ecosystems)

Page 47: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

26

IST-CONTRACT Project Parameters

IST Framework 6 STREP Project Funded from the 5th Call IST

Focus: Contracts for Distributed

Applications Engineering Contracts as a basis for formal

verification e-business applications

Project ID: FP6-034418

Area: Digital Business Ecosystems

Costs: Total Cost: 2,509,156 Euro Req. Cont: 1,850,000 Euro

Dates: Start: 1st Sept 2006 End: 31st May 2009

Page 48: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

27

IST-CONTRACT Project Partners

Universitat Politècnicade Catalunya

Fujitsu EST Gmbh Czech Technical University

of Prague King's College London Imperial College London 3scale Networks S. L. CertiCon A. S. Lostwax Media Ltd. Y‘All B. V.

Page 49: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

28

The problem: Engineering applications in Cross Organisational Service Oriented Computing environments

The behaviour of a software application depends upon: Code, Execution Context (environment), Inputs

In a multi-organisational Distributed Business Application application: No-one has access to all the code No-one has access to all the execution context (Possibly) no-one has access to all inputs

Question: How do you predict the potential run-time behaviour of such applications?

Page 50: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

29

Project Core Idea

Normal Verification approaches for software will not work without full source code access. In Contract:

Instead of predicting actions w.r.t code, predict actions w.r.t obligations, rights, permissions

in Contracts Impacts:

Short term: application design tool Longer term: formal verification of distributed business

applications

Page 51: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

30

Where are the Contracts?

Contracts: Are the explicit, tangible representation of service interdependencies Make explicit the obligations of each of the parties in the transactions Make explicit what each system can expect from another

Bind together: The electronic interaction (web services) with The business obligation with Prediction as to whether the system will function to get the job done

Page 52: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

31

What does the Project Deliver?

Contract Framework – formal theoretical framework for distributed business application modelling based on the interchange of (electronic) contracts

Contracting Language – specifications of how the actors should interact electronically and how they should communicate

Contract Execution Environment for Web services – to create and execute contract-mediated business interactions

Verification, Monitoring and Analysis tools – to analyze and inspect deployed systems

Page 53: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

32

Overall Contract Framework

Page 54: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Contracting Language Communication Model

Page 55: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Contracting Language Communication Model

Domain Ontology Layer

Contract Layer

Message Content Layer

Message Layer

Interaction Protocol Layer

Context Layer

Page 56: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

33

Contracting Language Communication Model

Domain Ontology Layer

Contract Layer

Message Content Layer

Message Layer

Interaction Protocol Layer

Context Layer

Page 57: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

33

Contracting Language Communication Model

Domain Ontology Layer

Contract Layer

Message Content Layer

Message Layer

Interaction Protocol Layer

Context Layer

DomainOntology

ContractualOntology

Request

AgreeProtocolhandling: S1

S2

A contract: “the workshop is obliged torepair the car in 2 days”

Domain terms: car, workshop, repair

Statements / actions related to contracts: cancel(contract C1)

Message envelope + intentionality: from service S1 to service S2 …Request[cancel(contract C1)]

Interactioncontext:

Page 58: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

34

Electronic Contracts: components

Page 59: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

34

Electronic Contracts: components

Page 60: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

35

Electronic Contract: example

<ISTContract> ContractName="AftercareContract" StartingDate="2007-01-01T00:00:00+01:00" EndingDate="2008-01-01T00:00:00+01:00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ist-contract.org/schemas/ISTContract.xsd"> <Contextualization> ... </Contextualization> <Definitions> ... </Definitions> <Clauses> ... </Clauses></ISTContract>

Page 61: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

35

Electronic Contract: example

<ISTContract> ContractName="AftercareContract" StartingDate="2007-01-01T00:00:00+01:00" EndingDate="2008-01-01T00:00:00+01:00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ist-contract.org/schemas/ISTContract.xsd"> <Contextualization> ... </Contextualization> <Definitions> ... </Definitions> <Clauses> ... </Clauses></ISTContract>

<ContractParties> <Agent AgentName="KLM"> < AgentReference>http://www.ist-contract.org:8080/services/KLM </AgentReference> <AgentDescription>Royal Dutch Airlines</AgentDescription> </Agent> …</ContractParties>…<RoleEnactmentList> <RoleEnactmentElement AgentName="KLM" RoleName=“Operator"/> …</RoleEnactmentList>

Page 62: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

35

Electronic Contract: example

<ISTContract> ContractName="AftercareContract" StartingDate="2007-01-01T00:00:00+01:00" EndingDate="2008-01-01T00:00:00+01:00" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ist-contract.org/schemas/ISTContract.xsd"> <Contextualization> ... </Contextualization> <Definitions> ... </Definitions> <Clauses> ... </Clauses></ISTContract>

<ContractParties> <Agent AgentName="KLM"> < AgentReference>http://www.ist-contract.org:8080/services/KLM </AgentReference> <AgentDescription>Royal Dutch Airlines</AgentDescription> </Agent> …</ContractParties>…<RoleEnactmentList> <RoleEnactmentElement AgentName="KLM" RoleName=“Operator"/> …</RoleEnactmentList>

<Clause>…<ExplorationCondition> <BooleanExpression> Before(2007-07-1T15:30:30+01:00) </BooleanExpression> </ExplorationCondition> <DeonticStatement> <Modality><OBLIGATION></Modality> <Who> <RoleName>Operator</RoleName> </Who> <What> <ActionExpression> PayForEngine(amount, engine, Operator, EngineManufacturer) </ActionExpression> </What> </DeonticStatement></Clause>

Page 63: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

36

Example of deployment

Page 64: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

37

Verification Tool

Off-line tool implements verification mechanisms for contract-governed systems.

Capable to verify system behaviours through notions of compliance/violations of intended behaviours.

Based in the formal framework and the contract language semantics.

Ability to check systems with large state spaces Capable to generate counterexamples when dangerous or

conflicting situations are detected User friendly GUI

Page 65: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

38

Verification Tool components/process

Page 66: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

39

Example: Modular Certification Testing

Page 67: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

What does this give you?

System interactions are described in terms of obligations, permissions, prohibitions etc.

Agents can act according to expected behaviour

You never have to verify actual code

Seems like SciFi now - but these concepts willbe fundamental in 5, 10, 20 years.

Page 68: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Beyond Contracts

Still need to figure out how to actually build an systems which fulfill your contracts (!)

Contracts need to be connected to something - a context or an organisation - in order to have force - we might want to model that too

We can even go further...

Page 69: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Key Concepts

Projects:

Contract: http://www.ist-contract.org/

Alive: http://www.ist-alive.eu/

More Challenges:

Individual rational actions?

Autonomy v’s Control?

Interaction with Business / Legal Frameworks?

Page 70: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Business Relevance

Sounds business relationships are critical

Quality of Service

Management of Autonomy and Dependencies will be Mandatory

Page 71: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Some Final Thoughts

Page 72: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Services will fundamentally change the way the Internet works within the next 5-7 years

Page 73: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Services will fundamentally change the way the Internet works within the next 5-7 years

(and much of that change will happen in the next 2-3)

Page 74: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Web Services will fundamentally change the way the Internet works within the next 5-7 years

(and much of that change will happen in the next 2-3)

Not Convinced Yet?

Page 75: Web APIs - Infrastructure for the (Intelligent) Programmable Web (R&D Talk)

Conclusions

The programmable web is coming - faster than you might think

Huge challenges lie ahead in:

Making it work

Making it intelligent

Techniques from AI, Autonomous Systems, Multi-agent and the Semantic Web will be key to understanding the resulting ecosystems