OData Introduction and Impact on API Design (Webcast)

31
OData and Impact on API Design With Brian Pagano @brianpagano Greg Brail @gbrail Anant Jhingran @jhingran

description

We're in a data-driven economy. Web API designers need to define what and how to expose data from a variety of apps, services, and stores. What are challenges of unlocking data and opening up access in a straightforward and standards-compliant manner? Is OData the right tool for the job? Join Anant, Brian, and Greg for a discussion of OData, its API design implications, and the pros and cons of OData as an enabler of data integration and interoperability across Data APIs. We Will Discuss » - OData, SQL, and the "RESTification" of data - providing a uniform way to expose, structure, query and manipulate data using REST principles. - Opportunity and challenges for OData. - The questions of Web standards and proprietary versus open tools and protocols.

Transcript of OData Introduction and Impact on API Design (Webcast)

Page 1: OData Introduction and Impact on API Design (Webcast)

OData and Impact on API Design

With

Brian Pagano

@brianpagano

Greg Brail

@gbrail

Anant Jhingran

@jhingran

Page 2: OData Introduction and Impact on API Design (Webcast)

groups.google.com/group/api-craft

Page 3: OData Introduction and Impact on API Design (Webcast)

youtube.com/apigee

Page 4: OData Introduction and Impact on API Design (Webcast)

slideshare.net/apigee

Page 5: OData Introduction and Impact on API Design (Webcast)

Introductions OData Primer API Design The OData Community Conclusions

Page 6: OData Introduction and Impact on API Design (Webcast)

@gbrail@brianpagano@jhingran

Page 7: OData Introduction and Impact on API Design (Webcast)

Interactions are shifting to edge of enterprise

Business

Networks

Social

Networks

Apps

Your

Company

Your

Web Site

Your Store

Your apps

Your Data

APIs

What the means is that

you’ve think about “data” –

what you expose, and what

you collect “differently”

- API-centric

Page 8: OData Introduction and Impact on API Design (Webcast)

Exposing data attracts business to the core even if data is not your core business

http://blog.apigee.com/detail/api_strategy_talk_web_2.0/

See Amundsen’s Dogs, Information Halos and APIs: The epic story of your API Strategy »

Page 9: OData Introduction and Impact on API Design (Webcast)

Exposing Data is more than the “R” of CRUD in REST

M(E/A)SS OF

INTERCONNECTED DATA

GOOD CLEAN API’S

How do you go from the m(e/a)ss to clean APIs?

Page 10: OData Introduction and Impact on API Design (Webcast)

Two schools of thought

Table1 Table2

1 N

REST APIS

“Schema-ed” Relational or

Relational-like view of “data”

REST APIS

“Linked Data” view – individual

objects, with properties and

interconnections

Page 11: OData Introduction and Impact on API Design (Webcast)

Today we’ll discuss the “Schema-ed” view of the world, and in particular, the OData approach

1 N

REST APIS

Page 12: OData Introduction and Impact on API Design (Webcast)

Let’s look at OData requests and responses.

Page 13: OData Introduction and Impact on API Design (Webcast)

SQL Query OData Request

select * from products where id = 1 /Products(1)

select * from productswhere name = ‘Milk’

/Products?$filter=name eq ‘Milk’

select name from products /Products?$select=name

select * from products order by name /Products?$orderby=name

select * from products offset 10 limit 10 /Products?$top=10&$skip=10

select * from prices r, products p where r.id = p.id

/Products(1)?$expand=Prices

OData by Example

(* sort of)

Page 14: OData Introduction and Impact on API Design (Webcast)

/Categories?$filter=Name eq ‘Dairy’

Filters

Logical Operators

eq ne gt ge lt le eq or and

Arithmetic Operators

add sub mul div mod

Parenthesis Operator

()

Canonical Functions

substrof endswith startswith

length indexof replace substring tolower

toupper trim concat year years month day

days hour hours minute minutes second

seconds round floor ceiling isof cast

Page 15: OData Introduction and Impact on API Design (Webcast)

atom json xml

(plus any other IANA-defined media types)

*If the $format query option is present in a request URI it takes precedence over the value(s) specified in the Accept request header.

Format

/Categories?$format=json *

Page 16: OData Introduction and Impact on API Design (Webcast)

Metadata

<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">

<edmx:DataServices

xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"

m:DataServiceVersion="1.0">

<Schema Namespace="NorthwindModel"

xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"

xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"

xmlns="http://schemas.microsoft.com/ado/2008/09/edm">

<EntityType Name="Category">

<Key>

<PropertyRef Name="CategoryID" />

</Key>

<Property Name="CategoryID" Type="Edm.Int32" Nullable="false"

p8:StoreGeneratedPattern="Identity"

xmlns:p8="http://schemas.microsoft.com/ado/2009/02/edm/annotation" />

<Property Name="CategoryName" Type="Edm.String" Nullable="false"

MaxLength="15" Unicode="true" FixedLength="false" />

<Property Name="Description" Type="Edm.String" Nullable="true" MaxLength="Max"

Unicode="true" FixedLength="false" />

</EntityType>

</Schema>

</edmx:DataServices>

</edmx:Edmx>

Page 17: OData Introduction and Impact on API Design (Webcast)

Libraries

Page 18: OData Introduction and Impact on API Design (Webcast)

from http://www.odata.org/libraries

Page 19: OData Introduction and Impact on API Design (Webcast)

WTF is WCF?

Page 20: OData Introduction and Impact on API Design (Webcast)

Who is using OData?

Page 21: OData Introduction and Impact on API Design (Webcast)
Page 22: OData Introduction and Impact on API Design (Webcast)

Who created OData?

Page 23: OData Introduction and Impact on API Design (Webcast)
Page 24: OData Introduction and Impact on API Design (Webcast)

How does OData compare to other approaches?

Page 25: OData Introduction and Impact on API Design (Webcast)

Odata Request Web API Style

/Products(1) /Products/1

/Products?$filter=name eq ‘Milk’ /Products?name=Milk

/Products/1?$select=name /Products/1/name

/Products?$orderby=name /Products?orderby=name

/Products?$top=10&$skip=10 /Products?offset=10&limit=10

/Products(1)?$expand=Prices /Products/1?expand=Prices

OData or Not?

Page 26: OData Introduction and Impact on API Design (Webcast)

OData GData SOAP Observed API Patterns on the Web

Page 27: OData Introduction and Impact on API Design (Webcast)

How active is community support for OData?

Page 28: OData Introduction and Impact on API Design (Webcast)

Is it time to rally around a standard like OData?

Or is too early?

Page 29: OData Introduction and Impact on API Design (Webcast)

Should one implement OData?

Page 30: OData Introduction and Impact on API Design (Webcast)

Questions

Page 31: OData Introduction and Impact on API Design (Webcast)

THANK YOU

Greg Brail

@gbrail

Anant Jhingran

@jhingran

Brian Pagano

@brianpagano

Questions and ideas to:

groups.google.com/group/api-craft