Upload
emiliano-pecis
View
2.525
Download
0
Embed Size (px)
DESCRIPTION
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.
Citation preview
<Insert Picture Here>
Web Oriented Architecture (reloaded)
Emiliano PecisTechnology Business Unit
Wake Up, Neo. SOA has you…
Red or Blue pill?
WOA SOA
Agenda
WOA & SOA
<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
WOA – Web Oriented Architecture
WOA & SOA
WOA versus SOA: not a competition
The elements of WOA
Make it simple with mashups
WOA – All About Resources
WOA and low case semantic web
ReST vs SOAP
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
REST API
Sponsored Slide: WLP is REST enabled
Developing a scalable WOA
WOA and (server side) scalability
10110001011001011101100101100101110001110
101100010110010111011001011001011100011101111110001110
Application Servers
Web Servers
Ever Expanding Universe of Users
The need of a Datagrid
• Data grid brokers Data Supply with Data Demand
• Scale out Data Grid in middle tier using commodity hardware
Data Sources
Data Demand
Java Objects
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
How does it work?
• Data spread and backed up across Members
• Transparent to developer
• Members have access to all Data
• All Data locations are known – no lookup & no registry!
• Synchronous Update
• Avoids potential Data Loss & Corruption
• Predictable Performance
• Backup Partitions are partitioned away from Primaries for resilience
• No engineering requirement to setup Primaries or Backups
• Automatically and Dynamically Managed
• Write-behind
How does it work?
• Membership changes (new members added or members leaving)
• Other members, using consensus, recover and repartition automatically
• No in-flight operations lost, no availability gap!
• Some latencies (due to higher priority of asynchronous recovery)
• Information Reliability & Continuous Availability are the priorities
How does it work?
Sponsored Slide: Oracle Coherence
• Implements Map interface• Implements JCache interface• Real-time filterable (bean) events • Filters completely extensible• Processors applied in parallel (grid)• A large range of filters out-of-the-box• Implements listeners
WOA actors
Client sideClient side Server sideServer side
WOA actors #1: AJAX
• Asynchronous JavaScript and XML• Combination: XMLHttpRequest, xml,
dom, html, json• Enables the partial page refresh
feature
WOA actors #2: JS frameworks
• More high level than pure javascript
• Examples: dojo, scriptaculous, prototype, jquery, mooTools, yui
• A lot of stuff done, just invoke it!• Ready for ajax and json
WOA actors #3: Json
• JavaScript Object Notation• More light than XML (data with
less structures)• Directly interpretrated by javascript• No effort for creating / (de)
serializing a tree dom• Tens folders more fast• More simple to traverse and get
attributes
WOA developers love…
• Agile MVC framework like Grails• Complete lightweight container
like Spring• Lightweight application server• ORM like Toplink or Hibernate• Data cache layer like Coherence
or ehcache
Sponsored Slide: Weblogic Suite
• Startup the container with just a web profile (no ejb, no rmi, no jca, no jms)
• Weblogic Server supports Spring with a dedicated console
• Weblogic Server uses Toplink as ORM
• Weblogic Suite includes Oracle Coherence for the datagrid
• Coherence*Web is used to manage sessions in a datagrid fashion and to cache WLP objects
Scaling a SOA with the Datagrid
What does the scalable architecture need to ensure
• Avoid processing where possible • Avoid I/O where possible• Avoid serialization and de-serialization• Avoid sending large documents over network• Avoid distributed file schemes as your app scales up• Avoid driving increasing traffic to backend systems • Architect for performance from the beginning aka not
throwing hardware at the problem!
Data Grid for SOA Services
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 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.
Restifying and caching a SOA
• Problem• Siebel CRM works properly, but doesn’t scale as expected
• Challenges• Customer requires rapid access to accurate information• All data must be available for a Social CRM Mashup• Customer wants to cache better the most frequently invoked services
• Solution (*)• Implement a solution that is able to restify and cache all needed WS-SOAP
exposed by Siebel
(*) Custom solution, it’s not a product: just for demo purpose
Restifying and caching a SOA
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: 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: 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: 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: 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: 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
P
BBackup
Node
PrimaryNodeGet / Put (Cachekey)
Service Data
Coherence Data Grid
OSB ResultCache
Ora
cle
Serv
ice B
us
1. check cache
2. if results not in cache, invoke service & cache results
Resource
SOAP/XML
REST/JSON
Ora
cle
Web
log
ic
Porta
l O
ther
Porta
ls
•Siebel•WCM•Wiki•Blog•Forum•…
Any Web Services
Clie
nt /b
row
ser
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
Q&A