Woa. Reloaded

2,683
-1

Published on

Neo, wake up! SOA has you! :)

A complete accademic overview about the Web Oriented Architecture. A comparison between WOA and SOA is well described. What is ReST and why it is so important for the WOA. A proxy ReST-to-SOAP, based on Oracle Service Bus, is explained. Which products WOA lovers are searching for? This presentation has some "sponsored slides" from Oracle.

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,683
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
142
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Woa. Reloaded

  1. 1. Web Oriented Architecture (reloaded) Emiliano Pecis Technology Business Unit
  2. 2. <ul><li>Wake Up, Neo. SOA has you… </li></ul>
  3. 3. Red or Blue pill? WOA SOA
  4. 4. Agenda
  5. 5. WOA & SOA
  6. 6. <Insert Picture Here> “ In other words, the Web model provides a single, open, and unified information architecture that is consistent, easily consumed, extremely scalable, securable, very reusable, resilient, and highly federated.” Dion Hinchcliffe Founder, Hinchcliffe & Co. Dion Hinchcliffe’s Blog
  7. 7. WOA – Web Oriented Architecture
  8. 8. WOA & SOA
  9. 9. WOA versus SOA: not a competition
  10. 10. The elements of WOA
  11. 11. Make it simple with mashups
  12. 12. WOA – All About Resources
  13. 13. WOA and low case semantic web
  14. 14. ReST vs SOAP
  15. 15. Introducing REST <ul><li>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. </li></ul><ul><li>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. </li></ul><ul><li>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. </li></ul>
  16. 16. REST Patterns 1/2 <ul><li>Give every “thing” an ID (URI): </li></ul><ul><ul><ul><ul><ul><li>http://example.com/orders/2007/11 </li></ul></ul></ul></ul></ul><ul><li>Link things together (Hypermedia links): </li></ul><ul><ul><ul><ul><ul><li><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> </li></ul></ul></ul></ul></ul><ul><li>Use standard methods (HTTP verbs) </li></ul><ul><ul><ul><ul><ul><li>GET is safe and idempotent </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>PUT and DELETE are not safe but are idempotent </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>POST is neither safe nor idempotent </li></ul></ul></ul></ul></ul>
  17. 17. REST Patterns 2/2 <ul><li>Resources with multiple representations </li></ul><ul><ul><ul><ul><ul><li>GET /customers/1234 HTTP/1.1 Host: example.com Accept: application/vnd.mycompany.customer+xml </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>GET /customers/1234 HTTP/1.1 Host: example.com Accept: text/x-vcard </li></ul></ul></ul></ul></ul><ul><li>Communicate statelessly </li></ul><ul><ul><ul><ul><ul><li>Cookies shouldn’t be used to encode information that can be transferred by other, more standardized means </li></ul></ul></ul></ul></ul>
  18. 18. REST Anti Patterns <ul><li>Tunneling everything through GET or POST </li></ul><ul><ul><li>http://example.com/some-api?method=deleteCustomer&id=1234 </li></ul></ul><ul><ul><li>Resources are not identified by URIs; rather, URIs are used to encode operations and their parameters </li></ul></ul><ul><ul><li>The HTTP method does not necessarily match the semantics </li></ul></ul><ul><ul><li>Such links are usually not intended to be bookmarked </li></ul></ul><ul><ul><li>There is a risk that “crawlers” (e.g. from search engines such as Google) cause unintended side effects </li></ul></ul><ul><li>Ignoring caching </li></ul><ul><ul><li>Cache-control: no-cache (always) </li></ul></ul><ul><li>Ignoring status code </li></ul><ul><ul><ul><li>Misusing of 200 or 500 status code </li></ul></ul></ul>
  19. 19. Processes and Resources
  20. 20. REST API
  21. 21. Sponsored Slide: WLP is REST enabled
  22. 22. Developing a scalable WOA
  23. 23. WOA and (server side) scalability
  24. 24. The need of a Datagrid <ul><li>Data grid brokers Data Supply with Data Demand </li></ul><ul><li>Scale out Data Grid in middle tier using commodity hardware </li></ul>Application Servers Web Servers Ever Expanding Universe of Users Data Sources Data Demand Java Objects 10110001011001011101100101100101110001110 101100010110010111011001011001011100011101111110001110
  25. 25. What is a datagrid? 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
  26. 26. How does it work? <ul><li>Data spread and backed up across Members </li></ul><ul><li>Transparent to developer </li></ul><ul><li>Members have access to all Data </li></ul><ul><li>All Data locations are known – no lookup & no registry! </li></ul>
  27. 27. <ul><li>Synchronous Update </li></ul><ul><li>Avoids potential Data Loss & Corruption </li></ul><ul><li>Predictable Performance </li></ul><ul><li>Backup Partitions are partitioned away from Primaries for resilience </li></ul><ul><li>No engineering requirement to setup Primaries or Backups </li></ul><ul><li>Automatically and Dynamically Managed </li></ul><ul><li>Write-behind </li></ul>How does it work?
  28. 28. <ul><li>Membership changes (new members added or members leaving) </li></ul><ul><li>Other members, using consensus , recover and repartition automatically </li></ul><ul><li>No in-flight operations lost, no availability gap! </li></ul><ul><li>Some latencies (due to higher priority of asynchronous recovery) </li></ul><ul><li>Information Reliability & Continuous Availability are the priorities </li></ul>How does it work?
  29. 29. Sponsored Slide: Oracle Coherence <ul><li>Implements Map interface </li></ul><ul><li>Implements JCache interface </li></ul><ul><li>Real-time filterable (bean) events </li></ul><ul><li>Filters completely extensible </li></ul><ul><li>Processors applied in parallel (grid) </li></ul><ul><li>A large range of filters out-of-the-box </li></ul><ul><li>Implements listeners </li></ul>
  30. 30. WOA actors <ul><ul><li>Client side </li></ul></ul><ul><ul><li>Server side </li></ul></ul>
  31. 31. WOA actors #1: AJAX <ul><li>Asynchronous JavaScript and XML </li></ul><ul><li>Combination: XMLHttpRequest, xml, dom, html, json </li></ul><ul><li>Enables the partial page refresh feature </li></ul>
  32. 32. WOA actors #2: JS frameworks <ul><li>More high level than pure javascript </li></ul><ul><li>Examples: dojo, scriptaculous, prototype, jquery, mooTools, yui </li></ul><ul><li>A lot of stuff done, just invoke it! </li></ul><ul><li>Ready for ajax and json </li></ul>
  33. 33. WOA actors #3: Json <ul><li>J ava S cript O bject N otation </li></ul><ul><li>More light than XML (data with less structures) </li></ul><ul><li>Directly interpretrated by javascript </li></ul><ul><li>No effort for creating / (de) serializing a tree dom </li></ul><ul><li>Tens folders more fast </li></ul><ul><li>More simple to traverse and get attributes </li></ul>
  34. 34. WOA developers love… <ul><li>Agile MVC framework like Grails </li></ul><ul><li>Complete lightweight container like Spring </li></ul><ul><li>Lightweight application server </li></ul><ul><li>ORM like Toplink or Hibernate </li></ul><ul><li>Data cache layer like Coherence or ehcache </li></ul>
  35. 35. Sponsored Slide: Weblogic Suite <ul><li>Startup the container with just a web profile (no ejb, no rmi, no jca, no jms) </li></ul><ul><li>Weblogic Server supports Spring with a dedicated console </li></ul><ul><li>Weblogic Server uses Toplink as ORM </li></ul><ul><li>Weblogic Suite includes Oracle Coherence for the datagrid </li></ul><ul><li>Coherence*Web is used to manage sessions in a datagrid fashion and to cache WLP objects </li></ul>
  36. 36. Scaling a SOA with the Datagrid
  37. 37. What does the scalable architecture need to ensure <ul><li>Avoid processing where possible </li></ul><ul><li>Avoid I/O where possible </li></ul><ul><li>Avoid serialization and de-serialization </li></ul><ul><li>Avoid sending large documents over network </li></ul><ul><li>Avoid distributed file schemes as your app scales up </li></ul><ul><li>Avoid driving increasing traffic to backend systems </li></ul><ul><li>Architect for performance from the beginning aka not throwing hardware at the problem! </li></ul>
  38. 38. Data Grid for SOA Services <ul><li>Benefits </li></ul><ul><li>Up to10 fold reduction in latency times used Cached data </li></ul><ul><li>Cache available to other nodes in the cluster. </li></ul><ul><li>Data grid provides backup of cache to peer nodes </li></ul><ul><li>Cache can be persisted to the database using a number of mechanisms. </li></ul>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.
  39. 39. Restifying and caching a SOA <ul><li>Problem </li></ul><ul><ul><li>Siebel CRM works properly, but doesn’t scale as expected </li></ul></ul><ul><li>Challenges </li></ul><ul><ul><li>Customer requires rapid access to accurate information </li></ul></ul><ul><ul><li>All data must be available for a Social CRM Mashup </li></ul></ul><ul><ul><li>Customer wants to cache better the most frequently invoked services </li></ul></ul><ul><li>Solution (*) </li></ul><ul><ul><li>Implement a solution that is able to restify and cache all needed WS-SOAP exposed by Siebel </li></ul></ul><ul><li>(*) Custom solution, it’s not a product: just for demo purpose </li></ul>
  40. 40. Restifying and caching a SOA
  41. 41. RSD: parse the URL http://siebel.com/rsd/catalog/product/id/5461 ?n1=v1&n2=v2… get / put / post / delete
  42. 42. 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
  43. 43. 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
  44. 44. 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
  45. 45. 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?
  46. 46. RSD: the configuration file GET /rsd/catalog/categories/id/3473
  47. 47. 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
  48. 48. 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
  49. 49. P B Backup Node Primary Node Get / Put (Cachekey) Service Data Coherence Data Grid OSB Result Cache Oracle Service Bus 1. check cache 2. if results not in cache, invoke service & cache results Resource SOAP/XML REST/JSON Oracle Weblogic Portal Other Portals <ul><li>Siebel </li></ul><ul><li>WCM </li></ul><ul><li>Wiki </li></ul><ul><li>Blog </li></ul><ul><li>Forum </li></ul><ul><li>… </li></ul>Any Web Services Client /browser
  50. 50. Restful Datagrid Reasonings <ul><li>In REST each resource has a unique URL </li></ul><ul><li>This URL is the primary key for the Datagrid (Coherence) </li></ul><ul><li>The cached value is stored in JSON format to be as “client ready” as possible </li></ul><ul><li>REST and JSON give developers more flexibility, ensuring a strong  light-matter coupling between content and its rapresentation </li></ul><ul><li>Javascript frameworks, like Jquery, allows developers to get JSON data from the datagrid and manipulate them as they prefer </li></ul>
  51. 51. Q&A
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×