SlideShare una empresa de Scribd logo
1 de 29
Descargar para leer sin conexión
OSGi Remote the Way
                 Transforming Services
              the World Runs Applications
                  A Flexible Foundation for
                              Composite Applications

  Holger Hoffstätte
  holger.hoffstatte@paremus.com


Paremus                                                         www.paremus.com                                                      Nov 2010
                 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Who am I?
  •              Transforming the Way
          Holger Hoffstätte (aka @asynchronaut)
          Living & working in Germany, near Cologne
             the World Runs Applications
  • Consulting Engineer for Paremus Ltd.
          Working on next-generation Service Fabric product line

  •       >20 years experience with concurrent/distributed systems, incl.
          Agile/Process coaching, AOP, B2B, Enterprise Integration etc.


Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
What's this about?
  •                Transforming the Way
          OSGi & Remote Services:
          Motivation & History
             the World Runs Specifications
  • Overview of Remote Services/RSA Applications
  • Applicability & Use Cases
          → little to no code!


Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
OSGi = SOA!
  •                    Transforming the Way
          Physical and logical isolation of Bundles

  •       Bundle Wiring with dynamic behaviour
                  the World Runs Applications
  •       Service registration, discovery & matching

  •       Lifecycle control

  •       In R4.2: scoped visibility of services & events

Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Systems Hygiene:
                            simply a good idea
                         Transforming the Way
          „The ability of OSGi to
                    the World Runs Applications
          handle complex systems as
          a set of interdependent
          modules is kind of like toilet
          paper: Sooner or later, you're
          going to want to use it.“
          – Hal Hildebrand


Paremus                                                               www.paremus.com                                                      Nov 2010
                       Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
..but what about Distributed
                   Systems?
               Transforming the Way
            the World Runs Applications




Paremus                                                      www.paremus.com                                                      Nov 2010
              Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
..hmm..why not..
                            Transforming the Way
          „Just use RMI or EJB!
          It's built-in and Standard!“ Runs Applications
                      the World
           – your local Architecture Astronaut




                            ...ooomphh →

Paremus                                                           www.paremus.com                                                      Nov 2010
                   Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
/**
           * Implementation of ICustomRemote Interface.
           */
          public class CustomRemoteImpl extends UnicastRemoteObject implements ICustomRemote {

              /**
               * Necessary because Super-Class constructor throws RemoteException.


                  Transforming the Way
               * @throws java.rmi.RemoteException Will be thrown if there are some network
               * errors.
               */
              public CustomRemoteImpl() throws RemoteException {
              }
               the World Runs Applications
              /**
               * Returns a string which say 'Hello World with RMI.'
               * @return the string which holds the value.
               * @throws java.rmi.RemoteException Will be thrown if there are some network
               * problems.
               */
              public String sayHello() throws RemoteException {


                                                                                                                    :-(
                  return "Hello World with RMI.";
              }
          }




Paremus                                                           www.paremus.com                                                      Nov 2010
                   Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
..hmm..why not..
                       Transforming the Way
          „We should just use JMS or
          our EnterpriseyWorld Runs Applications
                   the    'Service Bus' for
          everything!“
          – probably someone on your team



                    ..alrighty then.. →

Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
..hmm..why not..
                         Transforming the Way
          „I know! We can simply write
          our own RPC library over Runs Applications
                   the World
          sockets! It's so easy! I did
          that back in Uni!“
          – your „Rock Star“ intern

                                 ..oh noes! →

Paremus                                                                www.paremus.com                                                      Nov 2010
                        Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Sad Reality
  •               Transforming the Way
          Any kind of distribution often still hardwired into „stuff“
          (and nobody really understands how it works..or wants to)

  • System evolutionWorld Runs Applications the
             the often burdened with architectural decisions at
          wrong time of the development cycle:

      •    Distribution features added either „too early“ or „too late“

      •    Negatively impacts time-to-feature & subsystem/integration testing

      •    Iterations increasingly resemble wading through mud
Paremus                                                               www.paremus.com                                                      Nov 2010
                       Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Silver Lining?
  •              Transforming the Way
          Previous attempts:
          Tuscany SCA, R-OSGi, Newton..
             the or less similar
  • All have more World Runs Applications
          ideas: composite applications,
          distributed wiring..

  •       All more or less incompatible with
          each other and/or „standard“ OSGi
Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Key Realizations
                  Transforming theALL aspects:
  • Distributed systems need adaptability for Way
              the World Runs Applications
    development, testing, deployment, runtime, maintenance

  • No Silver Bullet/Golden Hammer possible:
          too many contradicting requirements like
          availability, cost, licensing, interop, latency, knowledge, security..



Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Standardize interaction,
                       not features!
                  Transforming the Way
  • Allow multiple implementations using different technologies
    side-by-side World Runs Applications
             the
  • Prevent „Golden Hammer Syndrome“:
          don't force choice of one technology for every kind of interaction,
          even when inappropriate



Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Consequences
                    Transforming OSGi service model:
  • Almost-transparent extension of the     the Way
             the World Runs Applications
    no explicit infrastructure API in „user code“!

  • No mandated use of SOAP/RMI/HTTP/JMS/etc.:
          choice of technology can be driven by requirements

  •       anything that moves bytes from A to B should be usable
          as transport!

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
OSGi EEG to
                                       the Rescue!
                   Transforming the Way
  • Definition of Remote Services in OSGi R4.2
              the World Runs Applications
  • Two minimalistic specs that accommodate each other:
   • Remote Services: the „mechanics“ of transports
   • Remote Service Admin: standardized discovery &
          import/export visibility control

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Remote Services
             Transforming the Way
          the World Runs Applications




Paremus                                                   www.paremus.com                                                      Nov 2010
           Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Remote Services
                   Transforming the Way between
   • Standardized Service Properties define the interaction
              the World Runs Applications
     participants

   • Abstract „Intents“ specify context-dependent „required vs. provided“
          capabilities; matched by standard OSGi filters

   •      Flexible configuration: properties, code, vendor-specific..


Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Remote Services
                      Transforming the Way
    Easier cross-platform
    integration for OSGi!
                the World Runs Applications
    ProtocolBuffers, Thrift,
    JSON-RPC, Avro..




                                                                     php
Paremus                                                           www.paremus.com                                                      Nov 2010
                   Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Remote Service Admin
             Transforming the Way
          the World Runs Applications




Paremus                                                   www.paremus.com                                                      Nov 2010
           Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Remote Service Admin
                   Transforming the Wayimplementors,
   • RSA itself merely an abstract control interface for
              the World Runs Applications
     usually the vendor of a distribution provider

   • Discovery providers discover/announce services on the network
   • „Topology Manager“ controls import/export visibility;
          specifics left to implementation → innovation!


Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Discovery
                  Transforming the Way
 • Discovery providers are simply „EndpointListeners“
             the World Runs Applications
   that map a specific service announcement to & from a
   standardized „EndpointDescription“

 •        Can use any mechanism that can store & update
          service state/visibility

 •        Obvious candidates: SLP, DNS-SD, Data Distribution Service,
          Apache Zookeeper, RDBMS, Data Grids, P2P Systems, DHTs..
Paremus                                                               www.paremus.com                                                      Nov 2010
                       Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Sounds awesome!
             Transforming the Way
          the World Runs Applications




Paremus                                                   www.paremus.com                                                      Nov 2010
           Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
..but not so fast!
                   Transforming the Way
   • Service interactions defined by Java interface
              the World Runs Applications
     – well-understood :-)
     – not very flexible :-(

   •      Fundamental limits to what can be
          expressed with a synchronous RPC model

   •      Fallacies of Distributed Computing etc.

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Problems with RPC
                   Transforming Detection (active & passive)
   • Lack of reliability necessitates Fault the Way
              the World Runs Applications
   • Call-by-reference vs. Call-by-value:
          impact on interaction semantics that cannot be ignored

   •      Latency spikes will introduce strong variance in perceived behaviour

   •      Variance adds up if remote services are chained

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
OSGi helps!
                    Transforming with „unexpected“ faults:
   • Can't fix the network, but does help the Way
               the World Runs Applications
     org.osgi.framework.ServiceException extends RuntimeException

   •      Service are expected to be dynamic – no change! :-)

   •      What changes is the scope of a disappearing service -
          ...but does that really matter? Gone is gone!

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Actual Benefits (1)
                   Transforming the that keeps crashing
   • Isolate that special third-party native code Way
               the World Runs Applications
     your entire JVM

   • Operational isolation through service visibility policies
          → smaller/faster test cycles → faster time-to-feature
          → no accidental crosstalk between development teams
          → runtime: security, confidentiality..

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Actual Benefits (2)
                   Transforming the updates of isolated
   • Ops teams usually more open to dynamic   Way
     services the World Runs Applications
              in separate processes – much easier now

   • Service Migration on host downtime
          → switching services much faster than host recovery/reboot

   •      Service selection based on cost/performance/latency..
          → finally a good reason to do proper end-to-end system design :)

Paremus                                                             www.paremus.com                                                      Nov 2010
                     Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
Implementations
                    Transforming the Way
               the World Runs on Eclipse Communication Framework
RSA Reference Implementation using
Apache CXF and Zookeeper
                                   Built Applications




                                                            Based on RI but rewritten for correctness, extensibility,
    Built with Tuscany/SCA                                  RSA compliance. Basis for commercial product.


Paremus                                                              www.paremus.com                                                      Nov 2010
                      Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.

Más contenido relacionado

Similar a OSGi Remote Services

Sitepen Getting There From Here
Sitepen   Getting There From HereSitepen   Getting There From Here
Sitepen Getting There From Here
George Ang
 
Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01
youzitang
 
Asynchronous Services – A promising future for OSGi - T Ward
Asynchronous Services – A promising future for OSGi - T WardAsynchronous Services – A promising future for OSGi - T Ward
Asynchronous Services – A promising future for OSGi - T Ward
mfrancis
 
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
mfrancis
 
Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...
mfrancis
 
Getting Your Head in the Clouds
Getting Your Head in the CloudsGetting Your Head in the Clouds
Getting Your Head in the Clouds
Andrew Townley
 

Similar a OSGi Remote Services (20)

Sitepen Getting There From Here
Sitepen   Getting There From HereSitepen   Getting There From Here
Sitepen Getting There From Here
 
Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01Openwebdylanqconbeijing 090423091545-phpapp01
Openwebdylanqconbeijing 090423091545-phpapp01
 
Asynchronous Services – A promising future for OSGi - T Ward
Asynchronous Services – A promising future for OSGi - T WardAsynchronous Services – A promising future for OSGi - T Ward
Asynchronous Services – A promising future for OSGi - T Ward
 
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and botoAutomating Oracle Database deployment with Amazon Web Services, fabric, and boto
Automating Oracle Database deployment with Amazon Web Services, fabric, and boto
 
TAUS USER CONFERENCE 2010, Man, Machine and advanced translation memory lever...
TAUS USER CONFERENCE 2010, Man, Machine and advanced translation memory lever...TAUS USER CONFERENCE 2010, Man, Machine and advanced translation memory lever...
TAUS USER CONFERENCE 2010, Man, Machine and advanced translation memory lever...
 
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
Cloud & OSGi - The Dawn of Composite Clouds (Now with demo videos)
 
StackStorm DevOps Automation Webinar
StackStorm DevOps Automation WebinarStackStorm DevOps Automation Webinar
StackStorm DevOps Automation Webinar
 
Why not ORM
Why not ORMWhy not ORM
Why not ORM
 
Mule ESB - Integration Simplified
Mule ESB - Integration SimplifiedMule ESB - Integration Simplified
Mule ESB - Integration Simplified
 
Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...Transaction Control – a Functional Approach to Modular Transaction Management...
Transaction Control – a Functional Approach to Modular Transaction Management...
 
Of innovation and impatience - Future Decoded 2015
Of innovation and impatience - Future Decoded 2015Of innovation and impatience - Future Decoded 2015
Of innovation and impatience - Future Decoded 2015
 
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
Just-in-time Java EE - provisioning runtimes for enterprise applications - Ja...
 
Designing our future overlords or: How I Learned to Stop Worrying and Love Ro...
Designing our future overlords or: How I Learned to Stop Worrying and Love Ro...Designing our future overlords or: How I Learned to Stop Worrying and Love Ro...
Designing our future overlords or: How I Learned to Stop Worrying and Love Ro...
 
Introduction To Spring Roo 1.0.0
Introduction To Spring Roo 1.0.0Introduction To Spring Roo 1.0.0
Introduction To Spring Roo 1.0.0
 
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
Paremus Cloud and OSGi Beyond the VM - OSGi Cloud Workshop March 2012
 
Mule Integration Simplified
Mule Integration SimplifiedMule Integration Simplified
Mule Integration Simplified
 
Oracle SOA Tips & Tricks
Oracle SOA Tips & TricksOracle SOA Tips & Tricks
Oracle SOA Tips & Tricks
 
Getting Your Head in the Clouds
Getting Your Head in the CloudsGetting Your Head in the Clouds
Getting Your Head in the Clouds
 
FraSCAti@rivieradev
FraSCAti@rivieradevFraSCAti@rivieradev
FraSCAti@rivieradev
 
Super feats of integration x pages with symphony sharepoint and office
Super feats of integration  x pages with symphony sharepoint and officeSuper feats of integration  x pages with symphony sharepoint and office
Super feats of integration x pages with symphony sharepoint and office
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

OSGi Remote Services

  • 1. OSGi Remote the Way Transforming Services the World Runs Applications A Flexible Foundation for Composite Applications Holger Hoffstätte holger.hoffstatte@paremus.com Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 2. Who am I? • Transforming the Way Holger Hoffstätte (aka @asynchronaut) Living & working in Germany, near Cologne the World Runs Applications • Consulting Engineer for Paremus Ltd. Working on next-generation Service Fabric product line • >20 years experience with concurrent/distributed systems, incl. Agile/Process coaching, AOP, B2B, Enterprise Integration etc. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 3. What's this about? • Transforming the Way OSGi & Remote Services: Motivation & History the World Runs Specifications • Overview of Remote Services/RSA Applications • Applicability & Use Cases → little to no code! Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 4. OSGi = SOA! • Transforming the Way Physical and logical isolation of Bundles • Bundle Wiring with dynamic behaviour the World Runs Applications • Service registration, discovery & matching • Lifecycle control • In R4.2: scoped visibility of services & events Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 5. Systems Hygiene: simply a good idea Transforming the Way „The ability of OSGi to the World Runs Applications handle complex systems as a set of interdependent modules is kind of like toilet paper: Sooner or later, you're going to want to use it.“ – Hal Hildebrand Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 6. ..but what about Distributed Systems? Transforming the Way the World Runs Applications Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 7. ..hmm..why not.. Transforming the Way „Just use RMI or EJB! It's built-in and Standard!“ Runs Applications the World – your local Architecture Astronaut ...ooomphh → Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 8. /** * Implementation of ICustomRemote Interface. */ public class CustomRemoteImpl extends UnicastRemoteObject implements ICustomRemote { /** * Necessary because Super-Class constructor throws RemoteException. Transforming the Way * @throws java.rmi.RemoteException Will be thrown if there are some network * errors. */ public CustomRemoteImpl() throws RemoteException { } the World Runs Applications /** * Returns a string which say 'Hello World with RMI.' * @return the string which holds the value. * @throws java.rmi.RemoteException Will be thrown if there are some network * problems. */ public String sayHello() throws RemoteException { :-( return "Hello World with RMI."; } } Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 9. ..hmm..why not.. Transforming the Way „We should just use JMS or our EnterpriseyWorld Runs Applications the 'Service Bus' for everything!“ – probably someone on your team ..alrighty then.. → Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 10. ..hmm..why not.. Transforming the Way „I know! We can simply write our own RPC library over Runs Applications the World sockets! It's so easy! I did that back in Uni!“ – your „Rock Star“ intern ..oh noes! → Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 11. Sad Reality • Transforming the Way Any kind of distribution often still hardwired into „stuff“ (and nobody really understands how it works..or wants to) • System evolutionWorld Runs Applications the the often burdened with architectural decisions at wrong time of the development cycle: • Distribution features added either „too early“ or „too late“ • Negatively impacts time-to-feature & subsystem/integration testing • Iterations increasingly resemble wading through mud Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 12. Silver Lining? • Transforming the Way Previous attempts: Tuscany SCA, R-OSGi, Newton.. the or less similar • All have more World Runs Applications ideas: composite applications, distributed wiring.. • All more or less incompatible with each other and/or „standard“ OSGi Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 13. Key Realizations Transforming theALL aspects: • Distributed systems need adaptability for Way the World Runs Applications development, testing, deployment, runtime, maintenance • No Silver Bullet/Golden Hammer possible: too many contradicting requirements like availability, cost, licensing, interop, latency, knowledge, security.. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 14. Standardize interaction, not features! Transforming the Way • Allow multiple implementations using different technologies side-by-side World Runs Applications the • Prevent „Golden Hammer Syndrome“: don't force choice of one technology for every kind of interaction, even when inappropriate Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 15. Consequences Transforming OSGi service model: • Almost-transparent extension of the the Way the World Runs Applications no explicit infrastructure API in „user code“! • No mandated use of SOAP/RMI/HTTP/JMS/etc.: choice of technology can be driven by requirements • anything that moves bytes from A to B should be usable as transport! Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 16. OSGi EEG to the Rescue! Transforming the Way • Definition of Remote Services in OSGi R4.2 the World Runs Applications • Two minimalistic specs that accommodate each other: • Remote Services: the „mechanics“ of transports • Remote Service Admin: standardized discovery & import/export visibility control Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 17. Remote Services Transforming the Way the World Runs Applications Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 18. Remote Services Transforming the Way between • Standardized Service Properties define the interaction the World Runs Applications participants • Abstract „Intents“ specify context-dependent „required vs. provided“ capabilities; matched by standard OSGi filters • Flexible configuration: properties, code, vendor-specific.. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 19. Remote Services Transforming the Way Easier cross-platform integration for OSGi! the World Runs Applications ProtocolBuffers, Thrift, JSON-RPC, Avro.. php Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 20. Remote Service Admin Transforming the Way the World Runs Applications Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 21. Remote Service Admin Transforming the Wayimplementors, • RSA itself merely an abstract control interface for the World Runs Applications usually the vendor of a distribution provider • Discovery providers discover/announce services on the network • „Topology Manager“ controls import/export visibility; specifics left to implementation → innovation! Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 22. Discovery Transforming the Way • Discovery providers are simply „EndpointListeners“ the World Runs Applications that map a specific service announcement to & from a standardized „EndpointDescription“ • Can use any mechanism that can store & update service state/visibility • Obvious candidates: SLP, DNS-SD, Data Distribution Service, Apache Zookeeper, RDBMS, Data Grids, P2P Systems, DHTs.. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 23. Sounds awesome! Transforming the Way the World Runs Applications Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 24. ..but not so fast! Transforming the Way • Service interactions defined by Java interface the World Runs Applications – well-understood :-) – not very flexible :-( • Fundamental limits to what can be expressed with a synchronous RPC model • Fallacies of Distributed Computing etc. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 25. Problems with RPC Transforming Detection (active & passive) • Lack of reliability necessitates Fault the Way the World Runs Applications • Call-by-reference vs. Call-by-value: impact on interaction semantics that cannot be ignored • Latency spikes will introduce strong variance in perceived behaviour • Variance adds up if remote services are chained Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 26. OSGi helps! Transforming with „unexpected“ faults: • Can't fix the network, but does help the Way the World Runs Applications org.osgi.framework.ServiceException extends RuntimeException • Service are expected to be dynamic – no change! :-) • What changes is the scope of a disappearing service - ...but does that really matter? Gone is gone! Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 27. Actual Benefits (1) Transforming the that keeps crashing • Isolate that special third-party native code Way the World Runs Applications your entire JVM • Operational isolation through service visibility policies → smaller/faster test cycles → faster time-to-feature → no accidental crosstalk between development teams → runtime: security, confidentiality.. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 28. Actual Benefits (2) Transforming the updates of isolated • Ops teams usually more open to dynamic Way services the World Runs Applications in separate processes – much easier now • Service Migration on host downtime → switching services much faster than host recovery/reboot • Service selection based on cost/performance/latency.. → finally a good reason to do proper end-to-end system design :) Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.
  • 29. Implementations Transforming the Way the World Runs on Eclipse Communication Framework RSA Reference Implementation using Apache CXF and Zookeeper Built Applications Based on RI but rewritten for correctness, extensibility, Built with Tuscany/SCA RSA compliance. Basis for commercial product. Paremus www.paremus.com Nov 2010 Copyright © 2010 Paremus Ltd. May not be reproduced by any means without express permission. All rights reserved.