43
Service Oriented Architectures Gustavo Alonso Computer Science Department Swiss Federal Institute of Technology (ETHZ) [email protected] http://www.iks.inf.ethz.ch/ 8

Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

Service Oriented Architectures

Gustavo Alonso Computer Science Department Swiss Federal Institute of Technology (ETHZ) [email protected] http://www.iks.inf.ethz.ch/

8

Page 2: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

The context for SOA

Page 3: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 3

A bit of history Enterprise computing has evolved along many directions in the

last decade: Data centers Islands of information Scale up vs. scale out Networking and distribution Internet and WWW Middleware RPC vs messaging Programming languages

This is an evolutionary process with many changes and many aspects to it but with common themes: Making enterprise IT more cost efficient and manageable Making systems faster, more robust, more flexible

We are in the middle of the evolution …

Page 4: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 4

An e-commerce platform

ASP SSL

FARM A

Games/Music Videos

Comp/Soft Books Music

SQL Product Server

ASP File Server

Cache Server

Basket/Ad/Surplus

Receipt/Fulfillment

Monitor and cache

ASP SSL

FARM B

Games/Music Videos

Comp/Soft Books Music

SQL Product Server

ASP File Server

Search Servers Search Servers

5 2 2 5 2

Diagram courtesy of Robert Barnes,

Microsoft

Page 5: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 5

Enterprise architecture at Credit Suisse Multiple backends, multiple frontends, flexible composition

Graphic courtesy of Claus Hagen, Stephen Murer and Hanspeter Uebelbacher of Credit Suisse

Page 6: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 6

Integration Infrastructure - Credit Suisse

CS EventBus Infrastructure (Message based)

CS Service Infrastructure (CORBA, Web Service based)

Server Server Core Banking Systems (Host) Core Banking

Systems (Host) Bought

Applications Bought

Applications

International IT Platforms International IT Platforms

Other Business Units

Other Business Units

Data Warehouses

Data Warehouses

Business Partners

Business Partners

App

Logic

App Logic

App

Logic

App Logic

App

Logic

App Logic

App

Logic

App Logic

Client Client Client Client Client Client Client Client

Bulk integration infrastructure (File Transfer)

Graphic courtesy of Claus Hagen, Stephen Murer and Hanspeter Uebelbacher of Credit Suisse

Page 7: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

Switching to services

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 7

Service Architecture adoption at Credit Suisse (graph courtesy of Stephan Murer)

Page 8: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 8

Many trends but one direction Dominant trends: Loose coupling Messaging (instead of RPC) Software encapsulation at a larger scale (service) Need for governance Reliance on more complex infrastructures

These elements are emphasized in different ways as

technology evolves.

Page 9: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 9

An integration backbone

Page 10: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 10

Imposing some order For many years, enterprise computing was very confusing: Many products Many platforms Incompatibilities Many different approaches Field was not yet mature

Service orientation is the first attempt at bringing some order Borrowing concepts from software engineering Making services the unit of discourse Understanding architectures Understanding the key concepts

Page 11: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

INTEGRATION TIER

ACCESS TIER

CLIENT TIER

APP TIER

wrapper

wrapper

wrapper

db db db

business object

business object

business object

api api api

web client

java client

applet client

WWW servers, J2EE, CGI JAVA Servlets API

databases, multi-tier systems backends, mainframes

system federations, filters object monitors, MOM

TP-Monitors, stored procedures programs, scripts, beans

WWW and WAP browsers specialized clients (Java, .NET)

Eclipse RCP, SMS ...

HTML, SOAP, XML

MOM, HTML, IIOP, RMI-IIOP, SOAP, XML

MOM, IIOP, RMI-IIOP, XML

ODBC, JDBC, RPC, MOM, IIOP, RMI-IIOP

Page 12: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 12

SOA metamodel

Page 13: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 13

What is SOA

SOA = Services Oriented Architecture Services = another name for large scale components

wrapped behind a standard interface (Web services although not only)

Architecture = SOA is intended as a way to build applications and follows on previous ideas such as software bus, IT backbone, or enterprise bus

The part that it is not in the name Loosely-coupled = the services are independent of each

other, heterogeneous, distributed Message based = interaction is through message exchanges

rather than through direct calls (unlike Web services, CORBA, RPC, etc.)

Page 14: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 14

The novelty behind SOA

The concept of SOA is not new: Message oriented middleware Message brokers Event based architectures

The current context is different

Emergence of standard interfaces (Web services) Emphasis on simplifying development (automatic) Use of complex underlying infrastructure (containers, middleware

stacks, etc.)

Interest in SOA arises from a number of reasons: Basic technology in place More clear understanding of distributed applications The key problem is integration not programming

Page 15: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

Web Services and SOA

Page 16: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 16

Automatic Software Generation

High Level

Declarative

Programming

Enactment,

enforcement

adaptation,

failure handling,

notification

Extension,

compilation,

resolution,

monitoring

Programmer domain

System domain

Page 17: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 17

System Integration SOA is not an abstract idea, it is a response to Very well defined needs in enterprise computing Changes in technology (cluster, networking, distribution) The Internet Business-to-Business integration Enterprise Computing coming of age Large scale distributed information systems

To understand SOA, the key is to understand the underlying

problems, not just the technology involved in solving them

Page 18: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 18

Automatic Plumbing Generation The promise of SOA is to facilitate integration by Letting the system automatically decide on integration

decisions

• protocols to use

• intermediate processing needed

• routing and distribution

• data transformations Enforcing standards for defining and operating with services Enforcing the use of service interfaces

Related to this, there are many additional opportunities: Languages for orchestration and composition Reasoning about compositions Integration by non-experts (IBM’s situational integration)

Page 19: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 19

Facilitate integration In the medium term, service

orientation will solve the problem of connectivity at the syntax level

Model Driven Architectures Business Processes Orchestration extensions

protocols

data map

mode

extensions

protocols

data map

mode

Programmer domain

System Domain

Page 20: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 20

WS standards

Page 21: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 21

Separation of concerns

Page 22: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

The software engineering aspects of SOA

Page 23: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 23

SOA is HAD HAD is an old concept in distributed information systems H = Heterogeneous A = Autonomous D = Distributed

HAD is The essence of and the reason for SOA The problem SOA tries to solve

HAD is where the OO paradigm has failed CORBA Object Oriented Databases Reuse

Page 24: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 24

No HAD in OO: OO Detours (Steve Cook, ECOOP 06)

Reuse Problem: Objects ignore the environment where they live Real objects in different systems are autonomous Real objects in different systems are heterogeneous

Distribution Problem: Abstracting away the problem’s essence Tight coupling (language, interaction, development, operation)

Database Problem: impedance mismatch Still present with XML, messages, and events

Modeling Problem: from OO models to software systems Objects are too low level to model real HAD systems

Page 25: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 25

Services not components The two sides: Integration is based on services Programming is based on objects and components

There are similarities in theory, in practice they are very different Services are not object oriented Services have document based interfaces Services have a behavioral contract with their consumers Services are reusable by definition Services are (should be) loosely coupled Services are autonomous Services have (very) explicit boundaries

Page 26: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 26

Objects – Components - Services

Object orientation

Compiler based Object/method interfaces Behavior explicit in object Program is closed world Programming language

Component systems

Middleware based Component interfaces Behavior in composition Program is open world Middleware + plumbing

Service platforms

Container + middleware Service interfaces Behavior in code, container and composition Autonomic, large scale

Programming languages

Component Models - Middleware

Service oriented architectures

Page 27: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

Services engineering

Page 28: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 28

Services: integration not programming The key issue in enterprise computing today is integration Services are the best way to approach integration known so

far

Page 29: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 29

What SOA is about

SOA is about: Non-functional properties of complex distributed systems:

performance, reliability, security, … Large scale composition Document and message based interaction Distributed systems architecture Run time properties and contracts Protocols, data formats Reusability

Conventional software engineering cannot address:

SOA and web services bring to the

fore the dependencies of existing

programming languages on (single

CPU) hardware concepts

Page 30: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 30

Two contemporary examples XML

Programming language variables

Semi-structured Documents

Procedural interfaces Document based

interfaces Behavioral interfaces

Variable assignment Declarative queries

Impedance mismatch

Asynchronous Data Streams Procedural control flow Event based control flow

Language based

distribution Platform based

distribution Behavioral interfaces

Sequential programs Highly parallel and

concurrent Model mismatch

Page 31: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 31

Services = run time Software Engineering A Service contract involves

the interface, the Service Level agreement and QoS

Contracts are key to be able to develop, debug, optimize and maintain systems developed as a combination of services

The management of the information about services, and the engineering of systems based on services leads to the notion of SOA Governance

Service contracts are not the

static, compile time pre-

and post-conditions of

conventional programming

languages

They are an additional software

layer in charge of the dynamic

aspects of using services

Page 32: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

Aspects of SOA Governance

Page 33: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 33

SOA Governance

Page 34: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 34

SOA governance SOA governance introduces different aspects to standard software

engineering concepts:

Service definition (the scope, interface, and boundaries of a service)

Service deployment lifecycle (the lifecycle stages) Service versioning (including compatibility) Service migration (deprecation and sunsetting) Service registries (dependencies) Service message model (canonical data models) Service monitoring (problem determination) Service ownership (corporate organization)

Page 35: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 35

Service definition The biggest challenge by service definition is to identify service

boundaries: Services are seen as having well defined, clear boundaries In practice, not that easy What is a service?

• Functionality vs data Data cohesion

• services that use common data are difficult to separate

Boundaries make sense at the business level not at the implementation level: A single database can expose many services but it remains a

single database

Page 36: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 36

Coupling Tighter coupling tends to cost more over time: Synchronization Coordinated deployment and deployment; updates Combinatorial explosion in dependencies Services are not independent (boundaries) Coupling implies more expensive testing

Looser coupling requires greater investment up front: More design work

• Generality

• Message model More implementation work

• Queues

• Message management

Page 37: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 37

Life cycle Services are autonomous entities used by other services Individual maintenance is not enough Coordination across entities Dependency management

Service versioning Necessary to maintain compatibility across dependencies

(otherwise all connected services need to be upgraded simultaneously)

Service migration Eventually all consumer services need to be migrated to the

newest version Cascading dependencies

Page 38: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 38

Registries for control and information The service registry serves as the name and directory server for

services and related information Versions available Services and providers Consumer and dependencies (less common)

UDDI specification quite useful for this purpose Technical information Documentation

Page 39: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 39

SOA development

Page 40: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 40

Message model Services are asynchronous and communicate through messages: What if each service defines its own messages What about formats and conventions

A message model acts as a standard determining The formats and conventions for messages May standardize messages as documents Published as canonical model

Page 41: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 41

Monitoring Processes and service composition involve the invocation of many

remote services What happens if the service is not there

• Exception, failure, error?

Services are autonomous

• Queues help

• Eventual manual intervention

How to fix the problem?

• Alternative services

• Migration

Several tools in the market

Page 42: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 42

Ownership Arbitrage is necessary when many consumer services use the

same provider service: Priorities Life cycle Versioning and migration Load and performance

Centralized and distributed solutions Both become complex at large scales

Page 43: Service Oriented Architectures - Systems Group · Service Oriented Architectures Gustavo Alonso ... The key issue in enterprise computing today is integration Services are the best

©Gustavo Alonso, Dept. of Computer Science, ETH Zürich. 43

Conceptual model