KEMBAR78
The RESTful Soa Datagrid with Oracle | PPT
The RESTful SOA Datagrid  (restify your world and put it in a cache) Emiliano Pecis Technology 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.1 Host: 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 BPM Portal Adapters B2B & BPM Service Repository Presentation Services Integration Services Service Orchestration Business Logic Business Logic
How Do We Deliver This Data ? Patterns of Services Traditional  Web Services Pre-negotiated Interfaces Contract (WSDL)  Standards in place, supported by many vendors SOAP over HTTP REST (Representational State Transfer) Based on Pattern of Service Invocation Nouns vs. Verbs URIs over HTTP RSS (Really Simple Syndication) Ad hoc channels of data XML format, content unstructured POX (Plain Old XML) Structure of Payload to determines action XML over HTTP
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
Data grid as Data Broker Data grid  brokers Data Supply with  Data Demand Scale out  Data Grid in middle tier using commodity hardware Application Servers Web Servers Ever Expanding Universe of Users Data Sources Data Demand Java Objects 10110001011001011101100101100101110001110 101100010110010111011001011001011100011101111110001110
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 Service Provider [data item] [data item] Service MySelfServPortal Coherence Grid Near Cache Cache This 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 side Server 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 cached Check 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 response Transform 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
 

The RESTful Soa Datagrid with Oracle

  • 1.
    The RESTful SOADatagrid (restify your world and put it in a cache) Emiliano Pecis Technology Business Unit
  • 2.
    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 )
  • 3.
  • 4.
  • 5.
    WOA – WebOriented Architecture
  • 6.
  • 7.
    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.
  • 8.
    REST Patterns 1/2Give 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
  • 9.
    REST Patterns 2/2Resources with multiple representations GET /customers/1234 HTTP/1.1 Host: example.com Accept: application/vnd.mycompany.customer+xml GET /customers/1234 HTTP/1.1 Host: 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
  • 10.
    REST Anti PatternsTunneling 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
  • 11.
  • 12.
  • 13.
    Parts of theRestful Soa Datagrid
  • 14.
    Parts of theRestful Soa Datagrid
  • 15.
    Core Value ofService Bus Service Intermediary & Management Service Location Transparency Service Virtualization Any to Any Protocol, Payload Configuration Advanced Integration Patterns High Availability & Scale Oracle Service Bus BPM Portal Adapters B2B & BPM Service Repository Presentation Services Integration Services Service Orchestration Business Logic Business Logic
  • 16.
    How Do WeDeliver This Data ? Patterns of Services Traditional Web Services Pre-negotiated Interfaces Contract (WSDL) Standards in place, supported by many vendors SOAP over HTTP REST (Representational State Transfer) Based on Pattern of Service Invocation Nouns vs. Verbs URIs over HTTP RSS (Really Simple Syndication) Ad hoc channels of data XML format, content unstructured POX (Plain Old XML) Structure of Payload to determines action XML over HTTP
  • 17.
    Final Thoughts… TrendsEmerging 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.
  • 18.
    Parts of theRestful Soa Datagrid
  • 19.
    Data Grid UsesCaching 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
  • 20.
    Data grid asData Broker Data grid brokers Data Supply with Data Demand Scale out Data Grid in middle tier using commodity hardware Application Servers Web Servers Ever Expanding Universe of Users Data Sources Data Demand Java Objects 10110001011001011101100101100101110001110 101100010110010111011001011001011100011101111110001110
  • 21.
    Data Grid forSOA 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 Service Provider [data item] [data item] Service MySelfServPortal Coherence Grid Near Cache Cache This is a very large piece of customer data that has to be obtained in one go from the system.
  • 22.
    Parts of theRestful Soa Datagrid
  • 23.
    Please do keepin 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
  • 24.
  • 25.
  • 26.
  • 27.
    Restful SOA DatagridArchitecture Oracle Service Bus Client side Server side
  • 28.
  • 29.
    RSD: parse theURL http://siebel.com/rsd/catalog/product/id/5461 ?n1=v1&n2=v2… get / put / post / delete
  • 30.
    RSD: check ifcached Check 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
  • 31.
    RSD: return cacheditem If the result has been taken from the cache return it
  • 32.
    RSD: set upWS 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
  • 33.
    RSD: the configurationfile 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?
  • 34.
    RSD: the configurationfile GET /rsd/catalog/categories/id/3473
  • 35.
    RSD: the responseGet the response Transform from XML to JSON Put it in the cache
  • 36.
    RSD: coherence integrationA custom OSB transport has been developed for Coherence by Bassam Hijazi
  • 37.
    Restful Datagrid ReasoningsIn 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
  • 38.
    Credits and resourcesCredits: 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
  • 39.