designing distributed object systems ian gorton, paul greenfield advanced distributed software...

46
Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Post on 15-Jan-2016

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Designing Distributed Object Systems

Ian Gorton, Paul Greenfield

Advanced Distributed Software Arhitectures and Technologies

CSIRO, Sydney

Page 2: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Who is CMIS?• CSIRO is Australia’s largest scientific R&D

organisation and has around 7000 staff

• CSIRO Mathematical and Information Sciences

is – Australia’s premier group of mathematicians and Information

Technology specialists working to improve performance in

Australian industry.

Page 3: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

ADSaT • 11 person R&D group, Sydney and

Canberra

• Involved in software engineering R&D

• Specifically looking at the problems of distributed systems, eg

• architecture, components, technologies

• testing and analysis

• performance, scalability, reliability

Page 4: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Architecture Issues

Solution Space

Physical constraints

Performance Requirements/Scalability

Security

Technologies, Components

Testing

Fault Tolerance

Trade-offs between competing forces can be extremely

complex

Management

Transactions

Page 5: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

ADSaT capabilities• Designing software architectures

• Expertise in enterprise distributed technologies (eg COM, ORBs, DCE, Java), transactions, databases

• Research based around software architectures

• In-depth knowledge of Internet and e-commerce issues

Page 6: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Week1 Distributed Systems Technology

Overview

Acronym frenzy!!

Page 7: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

What is Middleware?

Software plumbing and

associated services for building

distributed systems

Page 8: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Basic distributed systems blocks

• Provides high(ish) level facilities (RPC, RMI) for building distributed system communication infrastructures

• Hides low level issues from the programmer through abstraction Network/OS

TCP/IP

CORBA/RMI/COM

Component Technologies

The Next Big Thing??

Page 9: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Associated Services• Basic middleware

add-ons• Fulfill common

application needs in distributed systems

• See CORBA Services spec for an example and comprehensive list Middleware Plumbing

Secu

rity

Tra

nsa

ction

s

Dire

ctory

Messa

gin

g

Page 10: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Middleware Technologies• CORBA

• COM

• Java

• DCE

• Proprietary, ie– Forte, Tuxedo, CICS, etc..– TIBCO, MQ, etc..

Page 11: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

So What is it Good For?• Geek answer…

• Middleware makes it feasible ‘for mere mortals’ to build distributed software systems that are:

– high-performance, scalable

– reliable, high availability

• Don’t be fooled. Distributed systems are inherently difficult to build.

Page 12: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Er..try me again?

• The bottom line answer...

• Businesses need a WWW presence• secure, transactional accesses to business systems

• Integration• mergers, acquisitions, virtual enterprises

• Internet competition and time-to-market

Page 13: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Some Gartner Survey Figures

• To develop a currently competetive e-commerce site:

• 5 months average duration (some 1 year+)

• uses more than 1 consulting organization

• cost average US$1 million (~$350K-$2m+)

• 79% costs were labor, 10% s/w

• No enterprise WWW site was ‘on budget’

Page 14: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Gartner Group Predictions

• Simple site - $300k-$1 million

• Competetive site - $1-5 million

• Market leader - $5-20 million

• Site costs will increase 25% annually in next few years

Page 15: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Solving Business Problems with Middleware

• Legacy system access

• Data integrity

• Scalability

• Availability

• Client access

Page 16: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Legacy System Access• Ease legacy system

integration by providing standard interfaces (wrappers)

• Hides details of legacy systems from clients

CICS\VSAMAS400

Middleware Wrappers

Clients Clients

MQ CICSGateway

Server Server

Page 17: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Data Integrity• Ensuring data integrity

with distributed databases requires transactions

• Transactions ensure ACID properties

SQL ServerOracle

Clients Clients

SQL ODBC

Server Server

TP Service

Page 18: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Scalability• Middleware

supports scaling system performance by service replication

• This isn’t free - it requires good architecture! Clients Clients

Server Server

Page 19: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Availability• Replication enhances

fault tolerance and improves availability

• Graceful degradation, lower performance but it keeps running

Clients Clients

Server Server

Page 20: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Client Access• Client access

enhanced due to:– physical distribution– variety of access

technologies (ie Internet protocols, IIOP, COM) and available bridges.

Clients Clients

ServerWWWServer

IIOP

Clients

IIOP

COM Bridge

HTTP

Page 21: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Enterprise Middleware Products

• Some terminology first:• Middleware - basic products

• Orbix, Visibroker, DCE, Java RMI, COM

• Object Transaction Monitor (OTM)• middleware plus enterprise systems capabilities,

OrbixOTM, BEA WebLogic

• Application Server• cynical answer - new name for OTMs with Java 2

Enterprise Edition support :-}

Page 22: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

N-Tier System ArchitectureClient layer (browser, applets, apps)

Business Logic (CORBA objects, EJBs, COM+)

Data Access (DBMSs)

WWW server (WWW server, JSPs, ASPs)

http, IIOP, COM, RMI, XML

IIOP, COM, RMI, XML

SQL, ODBC, JDBC, XA

Page 23: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Standards (wot standards?)

• CORBA - OMG

• Java 2 Enterprise Edition (EJB+JMS+JNDI+…) - Sun

• COM+ - Microsoft

• MQ Series - IBM

• TIBCO multicast protocol..

• ???

Page 24: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

CORBA

• OMG is vendor consortium

• CORBA Interface Definition Language (IDL)

• Internet Inter-ORB Protocol (IIOP) (GIOP over TCP/IP)

• CORBA services, eg transactions, naming, events, security

Page 25: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Java

• Remote Method Invocation (RMI)• Sun’s JRMP or RMI-over-IIOP

• Enterprise Java Beans (EJBs)

• Java Transaction Service (JTS)• Java mapping to CORBA OTS

• Java Naming and Directory Interface (JNDI)

• Java Messaging Service (JMS)

Page 26: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

EJBs• EJBs are server-side components

• Separate business logic from infrastructure code

EJBEJB EJB

EJB Container

Page 27: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

EJBs

• EJBs capture design patterns:• Stateless Session Bean

• Stateful Session Bean

• Entity Bean (bean or container managed)

• Containers/EJB Servers provide:• transaction policies

• security policies

• database connection pooling

• multi-threading

Page 28: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Transaction Service

• Essential for distributed transaction processing

• Manages consistent updates to multiple databases

• CORBA OTS, Java JTS, M’soft MTS

• X/Open DTP standards - XA

Page 29: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

ACID properties

• A set of operations that have ACID properties:– Atomic– Consistent– Isolated– Durable

• Classic example - a bank account transfer

Page 30: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Java Transaction Example

try {// Create a transaction.transaction.begin();// Invoke operations in transactionsavingsAccount.makeWithdrawal(50)chequeAccount.makeDeposit(50);// Commit the transaction.transaction.commit(true);

} catch (APP_ERROR ex) {transaction.rollback()

} catch (TRANSACTION_ROLLEDBACK ex) {// handle rollback}

Page 31: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Two-Phase CommitApplication Program

Transaction Manager

Resource Manager (RM)

commit

Prepare tocommit

Response(commitof abort)

commit orabort

Acknowledge

Page 32: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

X/Open Distributed TP Reference Model

Application Program

Transaction Manager

Resource Manager(RM)

CommunicationsResource

Manager(CRM)

TX

XA

TxRPCXATMICPI - C

XA+

Page 33: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

XA Interface details• Database must implement an XA library

compatible with transaction service product

• embedded SQL

• ODBC/DTC for SQL Server

• OCI for Oracle

• ??? Others...

• JDBC-2 incorporates XA support

• No XA - no distributed transactions

Page 34: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Directory Service

• Clients need to get references to server objects

• Server objects advertise their reference in a directory service

• Clients query the directory service to retrieve desired reference

• CORBA Naming service, JNDI, LDAP

Page 35: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Example Name Space

Bank

AccountsLoansStocks

QueryStock

NewStockService

HomeLoan

BusLoan

AccountService

Page 36: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Security

• Provide:• user authentication

• user/service authorization

• encryption

• Secure Socket Layer (SSL)• public key infrastructure

• asymmetric private and public keys

• X.509 digital certificates

Page 37: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Messaging

• Many apps require asynchronous communications

• CORBA event/notifcation/messaging service

• Java Messaging Service

• TIBCO/Rendezvous

• MQ Series

• others…

• More on these later...

Page 38: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

WWW Server Tier

• Need to accept HTML requests via HTTP post or get

• CGI scripts first used to add processing capability:

• spawn new process for each request

• slow, doesn’t scale

• Proprietary improvents• Netscape’s NSAPI, Microsoft’s ISAPI

Page 39: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Java Servlets/Server Pages

• Java platforms includes specs for:• servlets

• Java Server Pages (JSPs)

• Java servlets launched by WWW Server in response to URL request

• JSP’s allow code (eg Java beans) for formatting dynamic content to be embedded in HTML page

Page 40: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Java Servlets/Server Pages

WWWServer

URL JSP

App.Server

Component

Servlet

results

query

query

results

html

html

invoke

invoke

HTML

Page 41: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Extensible Markup Language (XML)

• Subset of SGML

• Standard textual format for structured documents

• Document Type Definition (DTD) defines document structure with tags for each entry in the document

• XML document instance contains both tags and document data

• Text format is easy to process

Page 42: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Sample DTD<?xml encoding="US-ASCII"?>

<!ELEMENT orders (order)*>

<!ELEMENT order (header,item+,total)>

<!ELEMENT header (billing_info,shipping_info)>

<!ELEMENT billing_info (name,address,credit_card)>

<!ELEMENT shipping_info (name,address)>

<!ELEMENT name (given,family)>

<!ELEMENT address (street,city,state,zipcode,country,phone)>

<!ELEMENT item (product_id,product_name,quantity,price)>

<!ELEMENT credit_card (#PCDATA)>

<!ELEMENT given (#PCDATA)>

<!ELEMENT family (#PCDATA)>

[…ELEMENTS MISSING…..]

<!ELEMENT product_id (#PCDATA)>

<!ELEMENT product_name (#PCDATA)>

<!ELEMENT quantity (#PCDATA)>

<!ELEMENT price (#PCDATA)>

<!ELEMENT total (#PCDATA)>

Page 43: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Sample (Incomplete) XML Document<?xml version="1.0"?>

<!DOCTYPE orders SYSTEM "orders.dtd">

<orders>

<order>

<header>

<billing_info>

<name>

<given>John</given>

<family>Doe</family>

</name>

<address>

<street>555 Main Street</street>

<city>Mill Valley</city>

<state>California</state>

<zipcode>94520</zipcode>

<country>USA</country>

<phone>707 555-1000</phone>

</address>

Page 44: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Extensible Style Language (XSL)

• XML ignores presentation of data

• XSL stylesheets define presentation of XML doc in some format

XMLDoc

XSL

Compiler HTML, PDF,etc...

in browser or WWW server

Page 45: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

XML/XSL Impact

• Major vendor support/momentum

• Presentation• Decoupling content/presentation is good!

• Presentation is the browser’s job

• Data interchange• business-to-business e-commerce

• DOM API - XML parsers produce a DOM representation of an XML document

• Microsoft’s SOAP

Page 46: Designing Distributed Object Systems Ian Gorton, Paul Greenfield Advanced Distributed Software Arhitectures and Technologies CSIRO, Sydney

Summary

• Distributed object system technology is a key part of building enterprise distributed systems

• There’s a lot of :• design issues

• technology issues

• plain hard issues (ie testing)

• This course is just the ‘entrée’...