architecting and implementing interoperable data services

36
MICROSOFT CONFIDENTIAL – INTERNA Marc Mercuri Sr. Director Applied Incubation Architecting and Implementing Interoperable Data Services Aaron Bosley Business Strategy Architect MCS Impact Team Ricardo Villalobos Sr. Developer Evangelist DPE Presented 2013

Upload: marc-mercuri

Post on 16-Apr-2017

205 views

Category:

Data & Analytics


3 download

TRANSCRIPT

Page 1: Architecting and Implementing Interoperable Data Services

Marc MercuriSr. DirectorApplied Incubation

Architecting and Implementing Interoperable Data Services Aaron Bosley

Business Strategy ArchitectMCS Impact Team

Ricardo VillalobosSr. Developer EvangelistDPE

Presented 2013

Page 2: Architecting and Implementing Interoperable Data Services

Ok, so suppose we go ‘all in’ on cloud… We buy SaaS by default and build only what we need… what are you doing to make sure these services can talk to one another?

- Big Customer

Page 3: Architecting and Implementing Interoperable Data Services
Page 4: Architecting and Implementing Interoperable Data Services
Page 5: Architecting and Implementing Interoperable Data Services

This is the future

Wanted to extend functionalityInsertion of TripIt travel itineraries into online calendarsDetection of new travel itineraries directly from the user’s email inboxAutomated publishing of travel details to social networksIntegration of travel dates and trip segments into corporate expense reporting

IntegrationTripIt acts as a web services client to some of the APIsTripit makes itinerary available to other services via it’s APIsUsers need control over accessUsers don’t want to provide user credential for 3rd party services to TripIt

Page 6: Architecting and Implementing Interoperable Data Services

Types of services you might compose

Page 7: Architecting and Implementing Interoperable Data Services

Composition with Open Standards••

•••

Page 8: Architecting and Implementing Interoperable Data Services

Why are Data Services Important?

What exactly is a Data Service?

Page 9: Architecting and Implementing Interoperable Data Services

WhyBusiness has realized:Data is a strategic assetData can generate revenueData can build ecosystemsUsing data generates more data

Technology leaders have realized (painfully) that:Data is only as good/valuable/effective as the interfaces that exposes itInteroperability is best achieved thru standardization and simplicity

Page 10: Architecting and Implementing Interoperable Data Services

What

Loosely CoupledStateless

Asynchronous

DiscoverableEvolvable

Page 11: Architecting and Implementing Interoperable Data Services

Data Service Architectural Attributes

Page 12: Architecting and Implementing Interoperable Data Services

Logical Architecture

Client

Data Service

HTTP Listener

Data Service Runtime

Data Abstraction Layer

Data Providers

SQL NoSQL

Other

Page 13: Architecting and Implementing Interoperable Data Services

Example Data Services architecture

Browser

Browser

Browser

.Net Web App

OData Client Lib

Ruby on Rails Web App

OData Client Lib

Windows Azure

Application

ODataService

SQLAzure

Windows Azure Tables

<OData Protocol>

<OData Protocol>

Java Application

ODataService

<OData Protocol>

Browser

Browser

Browser

.Net Web App

OData Client Lib

Ruby on Rails Web App

OData Client Lib

Windows Azure

Application

ODataService

SQLAzure

Windows Azure Tables

<OData Protocol>

<OData Protocol>

Java Application

ODataService

<OData Protocol>

Page 14: Architecting and Implementing Interoperable Data Services

OData for Beginners

Page 15: Architecting and Implementing Interoperable Data Services

OData in 1 slideURL conventionsCollections, keys, filtering, sorting, paging, etc.

Representation for structured dataJSON and Atom/XML formats, pointers to unstructured data

OperationsGET, POST, PUT/PATCH, DELETE have well-established semantics

DescriptionService description in terms of structure, interaction and metadata in general

Page 16: Architecting and Implementing Interoperable Data Services

Libraries for serving and consuming ODataMOBILE DEV

Windows Phone Android iOS

APP DEV

Silverlight .NET JavaScript

Java PHP Ruby

WEB CMS

Joomla Drupal

CUSTOM SERVERS

.NET servers Java PHP

node.js

CLOUD APPLICATIONS

App Engine Azure

DATABASES

SQL Server MySQL Azure Data

Page 17: Architecting and Implementing Interoperable Data Services

Implementation optionsASP.NET web APIBest for API focused designAlso works best if you don’t have an IQueryable and/or if you have lots of business logicEasier to separate service interface from domain model/storage model

WCF data servicesWorks best for thin layers over databases/LINQ providers (you want to expose all data in the entity or schema)

ODatalibLowest-level library, lots of control but lots of workCovers most of the OData protocol, metadata drivenUse only if Web API or WCF doesn’t meet your needs

CustomDon’t do this

Page 19: Architecting and Implementing Interoperable Data Services

ASP.NET web API and ODataClient Routing Controller Model Data Provider View

Page 20: Architecting and Implementing Interoperable Data Services

Demo

OData Made Easy with ASP.Net Web API and Visual Studio 2013

Page 21: Architecting and Implementing Interoperable Data Services

• JavaScript on the ServerBased on the V8 JavaScript engine• Single thread based

Tasks run in parallel, node.js code orchestrates• Efficient and highly scalable

Each connection uses only a small heap allocation• Open and Portable

Single node.exe runtime for Windows / Linux

What is node.js?

Page 22: Architecting and Implementing Interoperable Data Services

node.exeSingle Thread

HTMLPage

DatabaseQuery

RESTfulCall

Databaseengine

Database Query Results

Work QueueResponse

Remote Client

Request

Single thread base

Asynchronous model, event loop with callbacks

Page 23: Architecting and Implementing Interoperable Data Services

node.js is…Excellent for: OK for:

Wrong for:

Page 24: Architecting and Implementing Interoperable Data Services

node.js and RESTBeing a language / engine based on JavaScript, REST and JSON are native to node.js, which means that creating a Service Layer on top of Database engines is simple and scalable.

UI

node.js Service Layer

MS SQL

ODATA

Page 25: Architecting and Implementing Interoperable Data Services

Demo

OData with Node.JS

Page 26: Architecting and Implementing Interoperable Data Services

Oauth for Beginners

Page 27: Architecting and Implementing Interoperable Data Services

What is it?An open protocol to allow secure authorization in a simple and standard method from web, mobile, and desktop applicationsFor service providers, OAuth gives users access to their data while protecting their account credentialsFor service consumers, Oauth is a simple way to publish and interact with protected data.

Page 28: Architecting and Implementing Interoperable Data Services
Page 29: Architecting and Implementing Interoperable Data Services

TerminologyResource OwnerClientResource ServerAuthorization ServerAccess TokenRefresh Token

Page 30: Architecting and Implementing Interoperable Data Services
Page 31: Architecting and Implementing Interoperable Data Services

Authorization code flow

B

A

BC

A ED

D

Page 32: Architecting and Implementing Interoperable Data Services

D

A

C

B

E

F

Associating Users and Apps with Devices

Page 33: Architecting and Implementing Interoperable Data Services

demo

link

Oauth in Action

Page 34: Architecting and Implementing Interoperable Data Services

OAuth Protocol Flow in Office 365

SharePoint 2013 content server

End user•••

Client app

Authentication server

1

2

3

4

5

6

7

8

9

10

Page 35: Architecting and Implementing Interoperable Data Services

A Composite Scenario

Picture Site

Page 36: Architecting and Implementing Interoperable Data Services

© 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.