the restful soa datagrid with oracle
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
<Insert Picture Here>
The RESTful SOA Datagrid (restify your world and put it in a cache)
Emiliano PecisTechnology Business Unit
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)
Agenda
What is REST
WOA – Web Oriented Architecture
WOA vs SOA
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.
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
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
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
Processes and Resources
Oracle parts involved
Parts of the Restful Soa Datagrid
Parts of the Restful Soa Datagrid
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
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.
Parts of the Restful Soa Datagrid
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
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
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.
Parts of the Restful Soa Datagrid
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
Coherence Transport Request Payload
Simple Put Request/Response
Restful SOA Datagrid
Restful SOA Datagrid Architecture
Oracle Service Bus
Client sideClient side Server sideServer side
Restful SOA Datagrid: OSB pipeline
RSD: parse the URL
http://siebel.com/rsd/catalog/product/id/5461
?n1=v1&n2=v2…
get / put / post / delete
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
RSD: return cached item
If the result has been taken from
the cache return it
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
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
?
RSD: the configuration file
GET /rsd/catalog/categories/id/3473
RSD: the response
Get the responseTransform from XML to JSON
Put it in the cache
RSD: coherence integration
• A custom OSB transport has been developed for Coherence by Bassam Hijazi
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
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