PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

40
1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

description

PaaS enabling Java EE applications through service meta-data and policies

Transcript of PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

Page 1: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

1 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

Page 2: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

2 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

LOGO

PaaS enabling Java EE applications through service meta-data and policiesBhavanisankara SapaligaJagadish Ramu

Birds Of Feather

Page 3: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

3 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

3 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Page 4: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

4 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Program Agenda• Introduction & Terminology• Service meta-data• Service Allocation Policy• Service Provisioning Order• Service Co-location Policy• Service Elevation Policy• SLA Policy• Service Augmentation Policy• Q& A

Page 5: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

5 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Cloud Computing

• On-demand Self-Service• Broad network access• Resource Pooling• Rapid Elasticity• Measured Service

Essential Characteristics

(*) NIST Definition of Cloud Computing – 800-145 (Draft)

Page 6: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

6 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Cloud Computing

• Software as a Service (SaaS)• Platform as a Service (PaaS)

– Deploy customer-created applications– Using languages and tools supported by PaaS Provider– No control of underlying cloud infrastructure– Control over deployed applications, hosting env. Configurations

• Infrastructure as a Service (IaaS)

Service Models

(*) NIST Definition of Cloud Computing – 800-145 (Draft)

Page 7: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

7 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

PaaS and Java EE

• Common programming model for enterprise developers• Runtime handles application’s infrastructure concerns• Declarative resource references• Scalable (scale-out) component models• Application deployment drives provisioning of services

required by the application• Using standards based application on a PaaS

Java EE design principles and capabilities

Page 8: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

8 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Roles in a PaaS scenario

Page 9: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

9 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

PaaS Implications on Deployment

• Automatic Service Provisioning and Management– Service Orchestration

• Automatic Service Dependency discovery• Service Provisioning and Association

– Handle operational infrastructure concerns automatically• Network configuration, HA, Clustering, Load Balancing …

– Application and Service deployment versioning

Services Management

Page 10: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

10 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

State of the proposals & work• Most of these meta-data are derived as part of our

investigation and prototype work• Conceptual at this stage, not all features/meta-data may

have implementation.• Part of the meta-data is based on existing/proposed

standards (eg: Java EE 6 & 7 annotations, Java EE standard descriptors)

Page 11: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

11 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Terminology• Service• ServiceType

– Java EE, RDBMS, HTTP Load Balancer etc.

• Services – scope and lifecycle– Provisioned Services

• Application scoped• Shared

– External (a priori ) services

• Metadata

– Descriptors, annotations for provisioning, policies, references

Page 12: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

12 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Scopes● Services are scoped at various levels

● Global services, available for all tenants

● Tenant scoped services, available for all deployments of a tenant

● Application scoped services, available only for an application

Page 13: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

13 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Scopes & Types

Page 14: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

14 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Metadata

• Provisioning meta-data or references can be specified along with the application (eg: services.xml)

• Vendor specific descriptors (eg: glassfish-resources.xml )

• Standard descriptors or annotations

● Java EE 6 & 7 - resource annotations

– DataSource, MailSession, JMSConnectionFactory, JMSDestination etc.,

Page 15: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

15 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Specification of Service Metadata

• Optional– When not specified (vanilla EE app archives)

• Orchestration Engine automatically handles discovery of service deps• Automatic wiring to default Service Templates

– Metadata may be specified when:• Finer grain control of application environment desired• Application-specific Service configuration

Page 16: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

16 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Metadata Usage

Page 17: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

17 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Specification of Service Metadata

• Service Definition– Metadata used to provision and configure a Service

• What : Service characteristics (functional and non-functional) → Template matching

• How : Explicit Template specification → Template wiring

• Service Reference– An application component’s dependency on a Service

• Explicit : User-specified through deployment descriptors• Implicit and Discovered: Information contained within the archive

Page 18: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

18 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Metadata specification

Page 19: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

19 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Sample Service Description

<service-description name="salary-service" init-type="lazy"> <!-- Based on the characteristics specified below, Orchestrator matches a Template and provisions that Service --> <characteristics> <characteristic name="service-type" value="Database"/> <characteristic name="product-vendor" value="Oracle"/> <characteristic name="product-name" value="OracleDB"/> <characteristic name="product-version" value="11g"/> <characteristic name="os-name" value="OEL"/> </characteristics> <configurations> <configuration name="database.init.sql" value="init.salary-service.sql"/> <configuration name="database.name" value="salary_database"/> </configurations></service-description>

Page 20: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

20 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service References● glassfish-resources.xml (Vendor specific descriptor):

<resources>

<jdbc-connection-pool res-type="javax.sql.DataSource" name="java:app/jdbc/test_pool">

<property name="service-name" value="global/mydb-service"/>

</jdbc-connection-pool>

<jdbc-resource pool-name="java:app/jdbc/test_pool" jndi-name="java:app/jdbc/MyRes"></jdbc-resource>

</resources>

● Services.xml

<!-- services.xml -->

<service-reference name="lb-ref" service-name="global/my-shared-lb-service">

Page 21: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

21 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service References● Using the @DataSourceDefinition annotation:

@DataSourceDefinition(

name="java:app/jdbc/DB1",

databaseName="sun-appserv-samples",

paas-enabled="true" | service-name=”global/mydb-service”

)

● Either paas-enabled or service-name can be specified.

● paas-enabled=”true” enables the dynamic binding of the @DSD to a Database service.

● A new Database service may get created or an existing service may be used (based on the allocation-policy)

● service-name=”global/mydb-service” binds this DSD to the mydb-service

Page 22: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

22 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Optional Service Dependencies

● An application can specify optional service dependencies.

● <service-ref name=”my-service-ref” service-type=”Caching” optional=”true”/>

● Optional, late binding of service depenencies● <service-ref name=”my-service-ref” service-name=”Caching”

optional=”true” late-binding=”true”/>

● Helps to notify when the optional service is made available later in the runtime so that the application or other dependent services can associate dynamically.

Page 23: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

23 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Naming conventions● JNDI style of name spaces:

● app/bookstore/BookstoreJavaService

● app/bookstore/BookstoreDBService

● tenant/tenant1/FooJavaEEService

● global/SharedOracleDBService

● Both shared and external services have “global/” namespace

● Using these naming conventions a service can be uniquely identified at any given scope

Page 24: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

24 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Sample Service Dependency Discovery

Page 25: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

25 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Allocation Policy

● Specified globally or per tenant level

● Default for all <service-reference> elements

● Can be over-ridden per :● service-type

● vendor-name

● product-name

● product-version

Page 26: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

26 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Allocation Policy

<tenant>

<policy>

<!-- valid values for allocation-policy are "shared | dedicated"-->

<service-allocation-policy allocation-policy="shared"/>

<service-ref type="JavaEE" allocation-policy="dedicated"/>

<service-ref type="Database" allocation-policy="dedicated"/>

<service-ref type="Database" allocation-policy="shared" vendor-name="Oracle" product-name="Oracle-Database" product-version="11g"/>

<!-- The entry below has same effect as unspecified since the default is “shared”-->

<service-ref type="LoadBalancer" allocation-policy="shared"/>

</service-allocation-policy>

</policy>

</tenant>

Page 27: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

27 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Provisioning Order

● Default : As specified in the meta-data “services.xml”

● Specify order in the service description

● Derive any implicit service requirements unspecified in meta-data and formulate dependency graph

● Cyclic dependencies

– Use existing shared service

– Use “optional”, “lazy-binding” options

– Fail !

Page 28: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

28 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Provisioning Order<service-provisioning-order>

<!-- provisioning-order can be of values "derived" or "meta-data"

"meta-data" : Indicates that provisioning should be as specified in "services.xml".

This can be natural ordering or via the attribute "order" in <service-description>

"derived" : Runtime determines the order by formulating service dependency graph -->

<provisioning-order mode ="meta-data"/>

<!-- cyclic-dependency-resolution can be done using :

"use-shared-service" : Use an existing shared service instead of new one.

"fail" : Fail provisioning

"lazy-binding" : Determine whether the Service Provisioning Engine can handle its service

dependency through "optional" and "lazy-binding" mode and apply accordingly. -->

<cyclic-dependency-resolution-policy mode="use-shared-service" >

</service-provisioning-order>

Page 29: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

29 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Co-location● Purpose:

● Multiple services or service nodes co-located in the same hardware (or virtual machine)

● Benefits:● Necessary for efficient use of hardware

● Helps the developer-mode deployments for unit testing multiple applications on the cloud

Page 30: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

30 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Co-location● Specification using services.xml:

<services>

<service-description name="myGlassFish">...</service-description>

<service-description name="myDatabase">...</service-description>

<service-description name="myLB">...</service-description>

<service-pool>myGlassFish,myDatabase,myLB</service-pool>

</services>

Page 31: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

31 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Co-location● Specification using policies : defines generic rule for co-locating

the services, in the absence of service-pool specified in services.xml

<policy>

<co-locate-services>

<service-ref type="JavaEE" vendor-name=”GlassFish”/>

<service-ref type="Database" vendor-name="JavaDB"/>

</co-locate-services>

</policy>

Page 32: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

32 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Elevation Policy

● Auto-detect and elevate an application-scoped-service to account scoped service

● When used as private cloud (on-premise), auto-detect and elevate an account-scoped-service to global-service

● Useful for optimized resource sharing with complete control

● Automatically downcast the scope when required so as to tie the service with application's state (enabled or disabled)

● Application disablement can also stop the running service to help reduce billing.

Page 33: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

33 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Elevation Policy<tenant>

<policy>

<service-elevation-policy enabled=”true”/>

<upcast-policy>

<event type=”app-deploy” applicable-scopes=”tenant, application”/>

<event-type=”app-redeploy” applicable-scopes=”tenant, application”/>

</upcast-policy>

<downcast-policy>

<event-type=”app-undeploy” applicable-scopes=”tenant, application”/>

<event-type=”app-redeploy” applicable-scopes=”tenant, application”/>

</downcast-policy>

<--elevation policy is disabled for LoadBalancer type -->

<service-type = “LoadBalancer” enabled=”false”/>

</service-elevation-policy>

</policy>

</tenant>

Page 34: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

34 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Level Agreement Policy● Service policies can be defined

<sla-policies>

<service-policy type="JavaEE">

<policy name=”max.concurrent.requests” exceeds=”10” action=”upgrade-account”/>

<policy name=”max.http.sessions” exceeds=”100” action=”upgrade-account”/>

</service-policy>

</sla-policies>

● These service policies will result in creating appropriate elasticity alerts and actions

Page 35: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

35 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Service Augmentation conventions● Upgrade the shared service to meet the application's

requirements

● For example, upgrade Java EE service from web-profile to full-profile

● Augmentation rules can be specified as policies● TBA

Page 36: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

36 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Resources

• Above the Clouds: A Berkeley View of Cloud Computing http://bit.ly/15MEL0

• The NIST Definition of Cloud Computing -- Special Publication 800-145(Draft) http://1.usa.gov/eZ8PSn

For more information

Page 37: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

37 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Q&A

Page 38: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

38 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.

Page 39: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

39 Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Classic Duke Future Tech Duke

Page 40: PaaS enabling Java EE applications through service meta-data and policies - Java One SFO 2012

40 Copyright © 2011, Oracle and/or its affiliates. All rights reserved.