35
IBM Software Group 1 http://tuscany.apache.org Luciano Resende [email protected] http://lresende.blogspot.com Jean-Sebastien Delfino [email protected] http://jsdelfino.blogspot.com SCA Reaches the Cloud Developing Composite Applications for the Cloud with Apache Tuscany

ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

1 http://tuscany.apache.org

Luciano [email protected]://lresende.blogspot.com

Jean-Sebastien [email protected]://jsdelfino.blogspot.com

SCA Reaches the Cloud

Developing Composite Applications for the Cloud with Apache Tuscany

Page 2: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

2 http://tuscany.apache.org

Agenda

Cloud Computing – Goals and Challenges

SCA – Goals and Overview

SCA – Typical Scenarios

Apache Tuscany

Tuscany Demo – Rewiring Components in the Cloud

Apache Nuvem

Nuvem Demo – Cloud friendly Components

Your Wish list?

Getting Involved

Page 3: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

3 http://tuscany.apache.org

Cloud Computing

Page 4: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

4 http://tuscany.apache.org

Cloud Computing – Some Goals

Up and running in seconds

Cheap

Scale up and down

Agile, reconfigure applicationsas business evolves

Page 5: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

5 http://tuscany.apache.org

Cloud Computing – Not so easy?

Different platforms and APIs (even languages) to learn... does my business logic need to know?

Am I getting OS images on demand? Infrastructure? an application platform?

Changing pricing models?

How do I integrate hybrid clouds, on premise + public cloud?

How do the various parts of my app communicate? Which protocols am I using?

How do I assemble / integrate them?

How do I configure the QOS I need?

How do I automate deployment?

Can I move some parts from one cloud to another?

Page 6: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

6 http://tuscany.apache.org

What is SCA ?

Page 7: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

7 http://tuscany.apache.org

SCA - Goals

Abstract out technical APIs, protocols, QOS

Allow me to focus on my business logic

Give me a structure for componentizing my app

Help me assemble, wire, rewire, move parts around

OASIS Standard (in progress)

Open Source implementations

Apache Tuscany

Fabric3

a few others

Product implementations

Initial target: SOA, Web Services, multi-language apps, application integration

Page 8: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

8 http://tuscany.apache.org

Can SCA components help you in the cloud?

We've been using different clouds in our Apache Tuscany work and are starting to realize that SCA components can help there too!

Components that easily communicate over a network

Components that shield you from different infrastructures

A way to describe your app and how it's assembled / wired

and can be distributed in a cloud or multiple clouds

Move components around clouds and rewire your app

Page 9: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

9 http://tuscany.apache.org

SCA – Assembly Model

Composite A

ComponentAService

Service Binding- Web Service- JMS- JCA- SLSB- HTTP- JSONRPC- ATOM- …

Reference Binding

ComponentB

Service Interface- Java- WSDL

Reference Interface- Java interface- WSDL PortType

Reference

property setting

Property

promotepromote wire

Implementation- Web Service- JMS- JCA- SLSB- HTTP- JSONRPC- ATOM- …

- Java- BPEL- SCA Composite- Spring- JEE- Scripting: Groovy, JScript, PHP, Python, Ruby, …- XQuery- …

Page 10: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

10 http://tuscany.apache.org

SCA – Example assembly

Store

CatalogCurrencyConverter

http

currencyCode=USD

jsonrpc

ShoppingCart

atom

jsonrpc

Collection

Total

<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://store" name="store">

<component name="Store"> <t:implementation.widget location="uiservices/store.html"/> <service name="Widget"> <t:binding.http uri="/store"/> </service> <reference name="catalog" target="Catalog"/> <reference name="shoppingCart" target="ShoppingCart/Cart"/> <reference name="shoppingTotal" target="ShoppingCart/Total"/> </component> <component name="Catalog"> <implementation.java class="services.FruitsCatalogImpl"/> <property name="currencyCode">USD</property> <service name="Catalog"> <t:binding.jsonrpc/> </service> <reference name="currencyConverter" target="CurrencyConverter"/> </component> <component name="ShoppingCart"> <implementation.java class="services.ShoppingCartImpl"/> <service name="Cart"> <t:binding.atom uri="/ShoppingCart/Cart"/> </service> <service name="Total"> <t:binding.jsonrpc/> </service> </component> <component name="CurrencyConverter"> <implementation.java class="services.CurrencyConverterImpl"/> </component>

</composite>

Page 11: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

11 http://tuscany.apache.org

SCA – if you don't like XML

final Composite comp = build(composite("http://sample", "test", component("client-test", implementation(ClientTest.class, service(Client.class), reference("jello", Hello.class), reference("wello", Hello_wsdl)), reference("jello", "jello-test"), reference("wello", "wello-test")), component("wello-test", implementation(WelloTest.class, service(Hello_wsdl), reference("upper", Upper_wsdl)), reference("upper", "upper-test")), component("jello-test", implementation(JelloTest.class, service(Hello.class), reference("upper", Upper.class)), reference("upper", "upper-test")), component("upper-test", implementation(UpperTest.class, service(Upper.class)))), ec);

Page 12: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

12 http://tuscany.apache.org

SCA – if you like Java annotations

ComponentAccountService

implmentation

@Remotablepublic interface AccountService {

AccountReport getAccountReport(String customerID);}

public class AccountServiceImpl implements AccountService {

…@Referencepublic void setAccountDataService(AccountDataService value) { accountDataService = value;}@Referencepublic void setStockQuoteService(StockQuoteService value) { stockQuoteService = value;}

@Propertypublic void setCurrency(String value) { currency = value;}

…}

Page 13: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

13 http://tuscany.apache.org

SCA – if you like to click around

• Eclipse STP Tools project provides SCA tooling

Page 14: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

14 http://tuscany.apache.org

SCA – Typical Scenarios

Page 15: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

15 http://tuscany.apache.org

Online Store<composite xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912" xmlns:t="http://tuscany.apache.org/xmlns/sca/1.1" targetNamespace="http://store" name="store">

<component name="Store"> <t:implementation.widget location="uiservices/store.html"/> <service name="Widget"> <t:binding.http uri="/store"/> </service> <reference name="catalog" target="Catalog"/> <reference name="shoppingCart" target="ShoppingCart/Cart"/> <reference name="shoppingTotal" target="ShoppingCart/Total"/> </component> <component name="Catalog"> <implementation.java class="services.FruitsCatalogImpl"/> <property name="currencyCode">USD</property> <service name="Catalog"> <t:binding.jsonrpc/> </service> <reference name="currencyConverter" target="CurrencyConverter"/> </component> <component name="ShoppingCart"> <implementation.java class="services.ShoppingCartImpl"/> <service name="Cart"> <t:binding.atom uri="/ShoppingCart/Cart"/> </service> <service name="Total"> <t:binding.jsonrpc/> </service> </component> <component name="CurrencyConverter"> <implementation.java class="services.CurrencyConverterImpl"/> </component>

</composite>

Store

CatalogCurrencyConverter

currencyCode=USD

jsonrpc

ShoppingCart

atom

jsonrpc

Collection

Total

Page 16: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

16 http://tuscany.apache.org

Gateway / Mediation

Gateway

jsonrpc

Service

<composite xmlns=http://docs.oasis-open.org/ns/opencsa/sca/200903 xmlns:t=http://tuscany.apache.org/xmlns/sca/1.1 targetNamespace=http://store name=”gateway">

<component name=”Gateway"> <implementation.java class="services.GatewayImpl"/>

<service name=”A"> <t:binding.jsonrpc/>

</service> <reference name=”refService”> <binding.x uri=“http://domain:8080/atomService”> </reference> </component> </composite>

Service

ShoppingCart

Page 17: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

17 http://tuscany.apache.org

Feed Aggregator / Converter

ATOMAggregator

Sort

RSS Aggregator

RSS

ATOM

RSS

ATOM

<composite xmlns=http://docs.oasis-open.org/ns/opencsa/sca/200903 xmlns:t=http://tuscany.apache.org/xmlns/sca/1.1 targetNamespace=http://store name=”feedAgregator">

<component name="AtomAggregator"> <implementation.java class="feed.AggregatorImpl"/> <reference name="sort" target="Sort"/>

<reference name="atomFeed1"> <tuscany:binding.atom uri="http://apache-tuscany.blogspot.com/feeds/posts/default"/> </reference> <reference name="atomFeed2"> <tuscany:binding.atom uri="http://feeds.feedburner.com/blogspot/Dcni?format=xml"/> </reference> <property name="feedTitle">Atom Aggregator Sample</property> </component>

<component name="Sort"> <implementation.java class="feed.SortImpl"/> <property name="newFirst">true</property> </component>

</composite>

Page 18: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

18 http://tuscany.apache.org

Business Integration – Travel Booking Process

JEE ComponentsPOJOsSpring AssembliesScripting ComponentsBPEL Processes

T u s c a n y S C AT o u r s U I

T r a v e l C a t a l o g

T r i p B o o k i n g

H o t e lP a r t n e r

F l i g h tP a r t n e r

C a rP a r t n e r

C u r r e n c yC o n v e r t e r

T r i pP a r t n e r

J a v a

J a v a

J a v a

J a v a

W i d g e t

f u l l a p p - u i ( 8 0 8 0 ) f u l l a p p - f r o n t e n d ( 8 0 8 4 )f u l l a p p - p a c k a g e d t r i p ( 8 0 8 5 )

f u l l a p p - b e s p o k e t r i p ( 8 0 8 6 )

f u l l a p p - c u r r e n c y ( 8 0 8 3 )

E J B

J a v a

J a v a

> l s - l s a

S C A T o u r s

J a v a

1 2 34 5 67 8 9

Page 19: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

19 http://tuscany.apache.org

Apache Tuscany

Page 20: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

20 http://tuscany.apache.org

Apache Tuscany

Lightweight SCA runtimes

Leverage and integrate with the Apache platform

Active Open-Source community, started in 2005

“Release early release often”, many releases

Two release streams, 1.x (stable), 2.x (trunk)

Working on OASIS SCA compliance

Innovations beyond the SCA spec (JSON, REST, ATOM, Comet etc)

SCA Java runtime, standalone or on Google AppEngine / Java, supports Java, scripting, BPEL, Spring components, and many protocol bindings

SCA Python runtime on Google AppEngine / Python

SCA Native, supports C++ and Python components

Page 21: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

21 http://tuscany.apache.org

Tuscany Demo – SCA Component Rewiring

SCA Java Application on EC2

Push one component out to Google AppEngine / Java

Rewrite it in Python and move it Google AppEngine / Python

Move it to a native SCA runtime on EC2

Easy runtime reconfiguration as you rewire the app

You've got choices, and can be agile!

Page 22: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

22 http://tuscany.apache.org

Tuscany Demo – SCA Component Wiring

CurrencyConverter

currencyCode=USD

jsonrpc

Catalog

FruitCatalog((Python))

FruitCatalog(Java)

store

Configuration Repository

FruitCatalog((Native))

TuscanyRuntimeShell

Page 23: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

23 http://tuscany.apache.org

Apache NuvemComponents for the Cloud

Page 24: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

24 http://tuscany.apache.org

Apache Nuvem - Overview

New project in the Apache incubator

Initial code contribution from Apache Tuscany

A few technical components already there

Running on Google AppEngine, today's demo also on EC2

Project is just starting so there's a lot of room for innovation!

Page 25: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

25 http://tuscany.apache.org

Nuvem, REST, and Cloud friendly Components

With REST, components get a simple GET/POST/PUT/DELETE interface

More importantly it's a fixed interface

Making components easier to assemble and compose

Like Lego blocks!

Web apps are starting to favor a protocol short list

HTTP verbs with some format variations (XML, ATOM, RSS, JSON)

That helps too!

What if you had a palette of Cloud friendly components?

Accessible through a simple REST interface

To help simplify your apps and enable them to work on different clouds?

Page 26: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

26 http://tuscany.apache.org

Nuvem Demo – Technical Components

SCA Java runtime on Google AppEngine / Java

Using different implementations of a simple datastore component

First using a HashMap

Second using Google's Memcached

Page 27: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

27 http://tuscany.apache.org

Nuvem Demo – Technical Components

CurrencyConverter

currencyCode=USD

jsonrpc

Catalog

VegetablesCatalog

store

ShoppingCartManager

User

MapDocumentService

MapDocumentService

Page 28: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

28 http://tuscany.apache.org

Nuvem Components – Wish list

Simple data store cache

Hierarchical cache, which can delegate to another cache

Invocation cache, which caches responses to requests

Key/value datastore

Simple (S)QL datastore

Datastore that understands master/slave replication and sharding

XMPP chat

Message queue

Oauth 1.0/2.0 + OpenID

User profile

Page 29: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

29 http://tuscany.apache.org

Cloud Components

What's your wish list?

Page 30: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

30 http://tuscany.apache.org

Getting Involvedwith Apache Tuscany

Page 31: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

31 http://tuscany.apache.org

SCA - Resources

Good introduction to SCA http://www.davidchappell.com/articles/Introducing_SCA.pdf

OASIS Open CSA – http://www.oasis-opencsa.org V1.1 level specs

http://www.oasis-opencsa.org/sca Open CSA Technical Committees

http://www.oasis-opencsa.org/committees

OSOA http://osoa.org/display/Main/Home More information on that site

http://osoa.org/display/Main/SCA+Resources

Page 32: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

32 http://tuscany.apache.org

Apache Tuscany Resources

Apache Tuscany

http://tuscany.apache.org

Getting Involved

http://tuscany.apache.org/getting-involved.html

Tuscany SCA Java Releases

http://tuscany.apache.org/sca-java-2x-releases.html

http://tuscany.apache.org/sca-java-releases.html

Tuscany SCA Java Documentation

http://tuscany.apache.org/java-sca-documentation-menu.html

Tuscany Dashboard

http://tuscany.apache.org/tuscany-dashboard.html

Page 33: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

33 http://tuscany.apache.org

Getting Involvedwith Apache Nuvem

Page 34: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

34 http://tuscany.apache.org

Apache Nuvem Resources

Apache Nuvem http://incubator.apache.org/nuvem/

Getting Involved http://incubator.apache.org/nuvem/nuvem-getting-involved.html

Page 35: ApacheCon NA 2010 - Developing Composite Apps for the Cloud with Apache Tuscany

IBM Software Group

35 http://tuscany.apache.org

Thank You !!!