the restful soa datagrid with oracle

38
<Insert Picture Here> The RESTful SOA Datagrid (restify your world and put it in a cache) Emiliano Pecis Technology Business Unit

Upload: emiliano-pecis

Post on 10-May-2015

20.056 views

Category:

Technology


3 download

DESCRIPTION

It transforms and caches any SOA based application in REST. A proxy "soap to rest" is provided, using Oracle Service Bus and Oracle Coherence.

TRANSCRIPT

Page 1: The RESTful Soa Datagrid with Oracle

<Insert Picture Here>

The RESTful SOA Datagrid (restify your world and put it in a cache)

Emiliano PecisTechnology Business Unit

Page 2: The RESTful Soa Datagrid with Oracle

Just for fun: some Anti SOA Quotes :)

• Implementing SOA for the first time is the triumph of imagination over intelligence

• Implementing SOA for the second time is the triumph of hope over experience

• One person successfully described SOA completely, and immediately died

• Guns don't kill people, the SOA WS-* stack kills people • SOA knows what you did last summer, and is

disappointed that it wasn't SOA

(from soafacts.com)

Page 3: The RESTful Soa Datagrid with Oracle

Agenda

Page 4: The RESTful Soa Datagrid with Oracle

What is REST

Page 5: The RESTful Soa Datagrid with Oracle

WOA – Web Oriented Architecture

Page 6: The RESTful Soa Datagrid with Oracle

WOA vs SOA

Page 7: The RESTful Soa Datagrid with Oracle

Introducing REST

• Nouns: All resources, or nouns, are network-addressable with a global URL. Resources have “href” references to other related resources. The only way to address a resource is with a URL.

• Verbs: A common set of verbs are used to access all resources. The HTTP methods GET, PUT, POST, and DELETE map to retrieve, update, create, and delete (CRUD) functions.

• Representations: A resource might be represented as XML, JSON, HTML, text, image, and so on. Instantiating representation from or to the resource is handled on the server. A client can pick its preferred representation via a URI parameter or the “Accept:” header.

Page 8: The RESTful Soa Datagrid with Oracle

REST Patterns 1/2

• Give every “thing” an ID (URI):• http://example.com/orders/2007/11

• Link things together (Hypermedia links):• <order self='http://example.com/customers/1234' >

<amount>23</amount> <product ref='http://example.com/products/4554' /> <customer ref='http://example.com/customers/1234' /> </order>

• Use standard methods (HTTP verbs) • GET is safe and idempotent• PUT and DELETE are not safe but are idempotent• POST is neither safe nor idempotent

Page 9: The RESTful Soa Datagrid with Oracle

REST Patterns 2/2

• Resources with multiple representations• GET /customers/1234 HTTP/1.1

Host: example.com Accept: application/vnd.mycompany.customer+xml

• GET /customers/1234 HTTP/1.1Host: example.com Accept: text/x-vcard

• Communicate statelessly • Cookies shouldn’t be used to encode information that can be

transferred by other, more standardized means

Page 10: The RESTful Soa Datagrid with Oracle

REST Anti Patterns

• Tunneling everything through GET or POST• http://example.com/some-api?method=deleteCustomer&id=1234• Resources are not identified by URIs; rather, URIs are used to encode

operations and their parameters• The HTTP method does not necessarily match the semantics• Such links are usually not intended to be bookmarked• There is a risk that “crawlers” (e.g. from search engines such as Google)

cause unintended side effects

• Ignoring caching • Cache-control: no-cache (always)

• Ignoring status code• Misusing of 200 or 500 status code

Page 11: The RESTful Soa Datagrid with Oracle

Processes and Resources

Page 12: The RESTful Soa Datagrid with Oracle

Oracle parts involved

Page 13: The RESTful Soa Datagrid with Oracle

Parts of the Restful Soa Datagrid

Page 14: The RESTful Soa Datagrid with Oracle

Parts of the Restful Soa Datagrid

Page 15: The RESTful Soa Datagrid with Oracle

Core Value of Service Bus

Service Intermediary& Management

• Service Location Transparency

• Service Virtualization

• Any to Any Protocol, Payload

• Configuration• Advanced

Integration Patterns

• High Availability & Scale

Oracle Service Bus

BPMPortal

Adapters

B2B & BPM

ServiceRepository

Service Orchestration

Presentation Services

Integration Services

Business Logic Business Logic

Page 16: The RESTful Soa Datagrid with Oracle

Final Thoughts…Trends Emerging

• Federated ESB• Not enough to simply distribute across buses.• Management is KEY.• Homogenous until vendors decide on management

standards to allow uniform service provisioning & routing updates.

• Event-driven SOA• Dynamic, unpredictable business events being correlated

real-time feeding into SOA infrastructure

• Web 2.0 meets SOA & Traditional IT infrastructure• Watch out - IT Culture class emerging! • Service Bus will help adapt Traditional SOA to more ad-hoc

services like REST, POX with security.

Page 17: The RESTful Soa Datagrid with Oracle

Parts of the Restful Soa Datagrid

Page 18: The RESTful Soa Datagrid with Oracle

Data Grid Uses

Caching

Applications request data from the Data Grid rather than backend data sources

Analytics

Applications ask the Data Grid questions from simple queries to advanced scenario modeling

Transactions

Data Grid acts as a transactional System of Record, hosting data and business logic

Events

Automated processing based on event

Page 19: The RESTful Soa Datagrid with Oracle

10110001011001011101100101100101110001110

101100010110010111011001011001011100011101111110001110

Application Servers

Web Servers

Ever Expanding Universe of Users

Data grid as Data Broker

• Data grid brokers Data Supply with Data Demand

• Scale out Data Grid in middle tier using commodity hardware

Data Sources

Data Demand

Java Objects

Page 20: The RESTful Soa Datagrid with Oracle

Data Grid for SOA Services

Coherence Solution• Developer integration to Coherence

APIs into service bus pipeline.• Named cache created using

CacheFactory • Optionally cache could be

implemented in orch. engine or portal

Benefits• Up to10 fold reduction in latency times

used Cached data• Cache available to other nodes in the

cluster.• Data grid provides backup of cache to

peer Coherence nodes• Cache can be persisted to the

database using a number of mechanisms.

Service Bus

Portal

Orchestration Engine

ServiceProvider

[data item]

[data item]

Service

MySelfServPortal

CoherenceGrid

NearCache

CacheThis is a very large piece of customer data that has to be obtained in one go from the system.

Page 21: The RESTful Soa Datagrid with Oracle

Parts of the Restful Soa Datagrid

Page 22: The RESTful Soa Datagrid with Oracle

Please do keep in Mind

• Great work developed by Bassam Hijazi• It’s a custom work (not supported)• New to Coherence• Inbound/Outbound • The transport only touches the surface of what

Coherence has to offer

Page 23: The RESTful Soa Datagrid with Oracle

Coherence Transport Request Payload

Page 24: The RESTful Soa Datagrid with Oracle

Simple Put Request/Response

Page 25: The RESTful Soa Datagrid with Oracle

Restful SOA Datagrid

Page 26: The RESTful Soa Datagrid with Oracle

Restful SOA Datagrid Architecture

Oracle Service Bus

Client sideClient side Server sideServer side

Page 27: The RESTful Soa Datagrid with Oracle

Restful SOA Datagrid: OSB pipeline

Page 28: The RESTful Soa Datagrid with Oracle

RSD: parse the URL

http://siebel.com/rsd/catalog/product/id/5461

?n1=v1&n2=v2…

get / put / post / delete

Page 29: The RESTful Soa Datagrid with Oracle

RSD: check if cachedCheck the cache only

if GET method has been used Assign a XML payload

to a variable

Send the payload to Coherence through the OSB Transport

if Coherence is not UP a WS call will be done

If the item is not in the cache a WS call will be

done)

Skipcache variable will be tested to decide if it is the case to return the cached value or

invoke the WS

Page 30: The RESTful Soa Datagrid with Oracle

RSD: return cached item

If the result has been taken from

the cache return it

Page 31: The RESTful Soa Datagrid with Oracle

RSD: set up WS call

This is the main configuration file.

From this file, RSD is able to match

the provided URL with all the parts of

a standard WS call: Business

Service, the Soap Action, the header

and body SOAP with the relative

parameters

Page 32: The RESTful Soa Datagrid with Oracle

RSD: the configuration file

GET /rsd/catalog/categories/id/3473

The following URI parts select the needed WS parts:

This is the SOAP

operation to invoke

This is the SOAP

payload to load

This is the SOAP

response to return

But, what about the

URL parameters

?

Page 33: The RESTful Soa Datagrid with Oracle

RSD: the configuration file

GET /rsd/catalog/categories/id/3473

Page 34: The RESTful Soa Datagrid with Oracle

RSD: the response

Get the responseTransform from XML to JSON

Put it in the cache

Page 35: The RESTful Soa Datagrid with Oracle

RSD: coherence integration

• A custom OSB transport has been developed for Coherence by Bassam Hijazi

Page 36: The RESTful Soa Datagrid with Oracle

Restful Datagrid Reasonings

• In REST each resource has a unique URL• This URL is the primary key for the Datagrid (Coherence)• The cached value is stored in JSON format to be as

“client ready” as possible• REST and JSON give developers more flexibility,

ensuring a strong light-matter coupling between content and its rapresentation

• Javascript frameworks, like Jquery, allows developers to get JSON data from the datagrid and manipulate them as they prefer

Page 37: The RESTful Soa Datagrid with Oracle

Credits and resources

Credits:

• How it all began: Using REST with Oracle Service Bus• OSB transport: great work developed by Bassam Hijazi• Interesting article by David Chappel: Not your MOM’s bus

Resources:

• A Brief Introduction to REST• Rest Anti-Patterns

Page 38: The RESTful Soa Datagrid with Oracle