+ All Categories
Home > Technology > Application Isolation - Is there an alternative to Subsystems - T Diekmann

Application Isolation - Is there an alternative to Subsystems - T Diekmann

Date post: 10-May-2015
Category:
Upload: mfrancis
View: 534 times
Download: 2 times
Share this document with a friend
Description:
With the release of the OSGi Enterprise Specification we now have defined what an application is in the context of OSGi rather than a traditional application server, think JEE. Running multiple applications in the same OSGi framework requires some form of isolation and visibility boundaries, which the subsystem specifications describes in detail. In a real world example of implementing a enterprise integration solution based on OSGi we found that the complexity of the metadata demanded by the subsystems spec can be overwhelming and hindering to customers. In this talk we outline an alternative approach to providing application isolation that is based on the location of the artifacts. The implementation relies on the same OSGi framework hooks as does the Subsystems specification. We will demonstrate the simplicity and advantages of the solution in comparison to the Subsystems spec. Any enterprise vendor considering adoption of OSGi is facing this very same problem and will be on the lookout for the best solution on behalf of their customers. We expect the audience to gain a better understanding of the current landscape and the alternatives in implementations. Bio: Tim is a Principal Architect at TIBCO Software Inc. working on the next generation of the flag ship enterprise integration product BusinessWorks. This award winning product has base of over 4000 customers around the globe. In his role he is responsible for the application hosting environment based on OSGi and the administration of the product. Tim has served as the co-chairman of the OSGi Enterprise Expert Group since its inception in 2006. He has been a regular speaker at EclipseCon/OSGi DevCon since 2007.
Popular Tags:
35
© Copyright 2000-2014 TIBCO Software Inc. Application Isolation Is there an alternative to Subsystems? Tim Diekmann Principal Architect TIBCO Software Inc. 1
Transcript
Page 1: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Application Isolation Is there an alternative to Subsystems?

Tim Diekmann!Principal Architect

TIBCO Software Inc.

1

Page 2: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Disclaimer

Any of the TIBCO ActiveMatrix BusinessWorks materials presented here is subject to change without notice. This document is TIBCO proprietary information. !This document (including, without limitation, any product roadmap or statement of direction data) illustrates the planned testing, release and availability dates for TIBCO products and services. This document is provided for informational purposes only and its contents are subject to change without notice.  !TIBCO makes no warranties, express or implied, in or relating to this document or any information in it, including, without limitation, that this document, or any information in it, is error-free or meets any conditions of merchantability or fitness for a particular purpose. 

2

Page 3: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Overview

• why multiple applications

• brief history of approaches

• OSGi solution

• why another solution

• Alternative OSGi solution

3

Page 4: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Why multiple applications? … in a single JVM that is

• save memory (objects and classes)

• reduce management and monitoring overhead

• save CPU on startup and load of applications

• multiple applications vs multi-tenancy

4

Page 5: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

very brief History• web resources

• web applications

• JEE application servers

• application servers like Apache Karaf, Eclipse Virgo, Paremus Service Fabric, IBM WebSphere, etc.

• what are applications?

5

Page 6: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc. 6

“Application software is all the computer software that causes a computer to perform useful tasks beyond the running of the computer itself.”

Wikipedia - http://en.wikipedia.org/wiki/Application_software

Application Definition

Page 7: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

* in the context of this presentation, Java, and OSGi

• packaged software deployed to an app server:

• versioned unit of release/maintenance

• providing coherent business function

• with a common life cycle

• possibly modular in composition

7

my Application Definition*

Page 8: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Problems• no isolation

• same OS process, OutOfMemoryErrors, in-memory access to other application data

• trade-off between sharing versus protecting

• no accounting

• unwanted side effects

• unit of certified deliverable

• cannot possibly test all potential interactions8

Page 9: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Approaches• servlet bridge

• nested / child OSGi frameworks

• Apache Karaf

• Eclipse features

• Eclipse Virgo

• IBM WebSphere, Paremus Service Fabric

9

Page 10: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

• Deployment Admin Service, Application Admin Service (older)

• nested OSGi framework

• Subsystems

• part of Enterprise Specification, introduced in R5

• based on experience in Eclipse Equinox, Virgo, Apache Aries, and others

• explicit model of sharing policies: share all, share selected, share nothing

• visibility boundaries for services, packages, events

• implementation boundary already provided by OSGi service model

10

OSGi Approaches

Page 11: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

• rich metadata supports large number of use cases

• common life cycle for constituents

• declarative approach

• independent of OSGi implementation

• reduces memory consumption by sharing

• supports dynamic resolution and installation of applications

• unresolved deployment

• SUBSYSTEM.MF vs DEPLOYMENT.MF

11

Advantages

Page 12: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

SUBSYSTEM.MF

Example of Subsystems Metadata

12

Manifest-Version: 1.0!Subsystem-ManifestVersion: 1.0!Subsystem-Name: Bank Account!Subsystem-SymbolicName: com.mybank.account.app!Subsystem-Version: 1.0!Subsystem-Type: osgi.subsystem.application!Subsystem-Content: !com.mybank.account.bankWeb; version=1.0.0,!com.mybank.account.bankAccount; version=1.0.0,!com.mybank.account.common; version=1.0.0,!com.mybank.account.utility; version=1.0.0!Use-Bundle: com.mybank.account.admin;version="[1.0.0,2.0.0)"!Subsystem-ExportService: com.mybank.account.service.AccountService!Subsystem-ImportService:!com.mybank.security.UserAuthService;filter="(security=strong)"

Page 13: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Drawbacks• complicated

• complex policy definitions

13

Page 14: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Drawbacks• complicated

• complex policy definitions

• configuration vs convention

• missing tooling: details exposed to users, application developers

• issues with common infrastructure services

• e.g. Configuration Admin, Event Admin, Declarative Services, Blueprint and other extenders

• application is aware of subsystem environment, not functional in OSGi environment without it

• modular applications require updates of metadata in multiple places

• think distributed application development

• dynamic changes to the application

• subsystem needs to be started to share code

14

Page 15: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

SUBSYSTEM.MF

Drawbacks

15

Manifest-Version: 1.0!Subsystem-ManifestVersion: 1.0!Subsystem-Name: Bank Account!Subsystem-SymbolicName: com.mybank.account.app!Subsystem-Version: 1.0!Subsystem-Type: osgi.subsystem.application!Subsystem-Content:!com.mybank.account.bankWeb; version=1.0.0,!com.mybank.account.bankAccount; version=1.0.0,!com.mybank.account.common; version=1.0.0,!com.mybank.account.utility; version=1.0.0!Use-Bundle: com.mybank.account.admin;version="[1.0.0,2.0.0)"!Subsystem-ExportService: com.mybank.account.service.AccountService!Subsystem-ImportService:!com.mybank.security.UserAuthService;filter="(security=strong)"

Page 16: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Subsystems Improvements• enhancements worked out in RFC 201 scheduled for

a later release of the Enterprise Specification

• header localization

• weaving hook integration / interaction

• provide deployment manifest at install time

• improve API for management agent

• determine service dependencies of applications

• revisit rules for preferred provider and application resolution

16

Page 17: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Alternative

• use existing ResolverHook, BundleCollisionHook, EventHook, FindHook etc

• model common infrastructure, shared libraries, applications based on file system location

• use bundle location to identify source

• apply visibility rules based on location

17

Page 18: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Layering

18

OSGi framework

JVM

Product Infrastructure

Shared SW Shared SW

Application Application Application

Page 19: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

File System Layout

19

OSGi framework

JVM

Product Infrastructure

Shared SW Shared SW

Application Application Application

$JAVA_HOME

~/product/lib

~/libs

~/apps

Page 20: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Solution• file system is source of truth for deployment

• use the JVM as-is with its boot and ext class loaders

• place product code in one folder or structure

• e.g. system or product

• place common infrastructure code in separate folder

• place shared libraries in separate folders

• not necessarily part of the product, separate lifecycle

• place applications in separate folders20

Page 21: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Visibility Boundaries

21

OSGi framework

JVM

Product Infrastructure

Shared SW Shared SW

Application Application Application

Page 22: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Advantages• simple

• understandable

• changeable, flexible

• structured by location in file system

• no other metadata required

• unless you want to model other dependencies and visibility boundaries

• compatible22

Page 23: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Implementation• different strategies possible

• multi-tier level visibility

• sensitive vs public services and code

• visibility boundaries enforced via ResolverHooks, EventHooks, FindHooks, even WaevingHooks

• change strategy via configuration

• support multiple singletons if required by business logic, e.g. static variables in common classes

23

Page 24: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Disadvantages

• may not support all complex use cases

• requires additional metadata to support finer grain sharing policies

• too simple?

24

Page 25: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc. 25

TIBCO ActiveMatrix BusinessWorksTM 6

Real World Example

Page 26: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

• ESB product, hosting multiple applications in single OSGi based runtime environment

• install product in one folder

• install applications in a different folder

• determine visibility and accessibility based on folder location

26

TIBCO BusinessWorksTM 6

Page 27: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Entitites• product

• BusinessWorks 6

• palettes (part of the product)

• ~16 Palettes

• product extensions

• palettes like salesforce.com, Twitter, etc.

• applications27

Page 28: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Folder Layoutproduct layout:

system contains all product code

ext contains links to product extensions

28

application layout:

grouped in AppSpaces

versioned

contains code and configuration

Page 29: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Visibility Boundaries• product is self-contained in system folder

• does not get wired outside of system folder

• product extensions are able to see and use anything in product folder

• can also supply their own versions of infrastructure bundles

• visible to all applications

• palettes sit above product and product extensions

• applications sit above palettes

• can provide infrastructure that is confined to application29

Page 30: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Visibility Boundaries

30

OSGi framework

JVM

BW framework

Application Application Application

BW extensions BW palettes

Page 31: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Applications

31

Application

Module

Module

Module

Application

Module

Module

Module

Page 32: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Specifics• separate public from internal APIs

• product internals are hidden from upper layers

• application support provided by Eclipse based designer

• additional application metadata

• application identification and versioning

• dependency management

• same hotfix mechanism for product as well as applications and extensions

32

Page 33: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

Hotfixing

• simple, file system based

• system/hotfix folder repeats structure under system

• any files in hotfix override files in original location

• works for outer flat class path as well as OSGi class path environments

33

Page 34: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

the end

34

questions?

Page 35: Application Isolation - Is there an alternative to Subsystems - T Diekmann

© Copyright 2000-2014 TIBCO Software Inc.

References• OSGi Alliance, http://www.osgi.org

• OSGi Core Specification, http://www.osgi.org/Download/File?url=/download/r5/osgi.core-5.0.0.pdf

• Enterprise Specification, http://www.osgi.org/Download/File?url=/download/r5/osgi.enterprise-5.0.0.pdf

• Introduction to Java Multitenancy, http://www.ibm.com/developerworks/library/j-multitenant-java/

• Apache Aries, https://aries.apache.org

• wikipedia.org, http://en.wikipedia.org/wiki/OSGi

• Equinox Regions, Mind the Gap Blog, http://underlap.blogspot.com/2011/02/stumbling-towards-better-design.html

• Paremus Service Fabric, http://www.paremus.com/products/products_psf.html

• TIBCO ActiveMatrix BusinessWorks 6, http://www.tibco.com/products/automation/application-integration/activematrix-businessworks/default.jsp

35


Recommended