Last Covered
Download
Report
Transcript Last Covered
Topics
•
To examine the variety of
approaches to handle the middleinteraction
(continued)
1.
2.
3.
4.
5.
6.
16 September 2008
RPC-based systems
TP monitors
Object brokers
Object monitors
Message-oriented middleware
Message brokers
#1
CIS 340
Generative Phases of
Middleware
Application
servers
Object
brokers
TP-Monitors
Transactional
RPC
Object oriented
RPC (RMI)
Message
brokers
Specialized forms of RPC
• typically with additional functionality or
properties
• almost always running on RPC platforms
Asynchronous
RPC
Remote Procedure Call:
• hides communication details behind a
procedure call
• helps bridge heterogeneous platforms
Remote Procedure Call
sockets
TCP, UDP
Internet Protocol (IP)
16 September 2008
sockets:
• operating system level interface to the
underlying communication protocols
TCP, UDP:
• User Datagram Protocol (UDP) transports
data packets without guarantees
• Transmission Control Protocol (TCP)
verifies correct delivery of data streams
Internet Protocol (IP):
• moves a packet of data from one node to
another
#2
CIS 340
Basic Middleware: RPC
What does an RPC system do?
• Hides distribution behind
procedure calls
• Provides an interface definition
language (IDL) to describe the
services
• Generates all the additional
code necessary to make a
procedure call remote and to
deal with all the
communication aspects
Basis for 2tier,
client/server
First
introduction
of elements
common to
all
middleware
• Provides a binder/binding in
case it has a distributed name
and directory service system
16 September 2008
#3
CIS 340
Basic Middleware: Transaction Monitor (TP-M)
• What is a Transaction?
• Where is the Problem?
• Transaction Monitor (TP-M)
16 September 2008
#4
CIS 340
What is a Transaction?
Def:
Logical unit of work that must be
either entirely completed or
aborted
• Reads from and/or writes to a database
– Simple SELECT statement
– Series of related UPDATE statements
changing values in various tables
– Series of INSERT statements to add rows
to one or more tables
– Combination of SELECT, UPDATE, and
INSERT statements
– Equivalent of a single SQL statement in an
application program doing the above
11 September 2008
#5
CIS 340
Where is the Problem?
Def:
Successful transaction changes database
from one consistent state to another
– One in which all data integrity
constraints are satisfied
Unsuccessful -- improper or incomplete
transactions can have devastating effect
on database integrity
– Some DBMSs offer enforceable integrity
constraints
– Other integrity rules are enforced automatically
by the DBMS
11 September 2008
#6
CIS 340
Where is the Problem?
•
•
•
•
RPC is a point to point protocol in the sense that it supports the
interaction between two entities
– the client and the server
When there are more entities interacting with each other RPC treats
the calls as independent of each other, however, the calls are not
independent
– a client with two servers,
– a client with a server and the server with a database
Recovering from partial system failures is very complex.
– For instance, the order was placed but the inventory was not
updated,
– payment was made but the order was not recorded …
Avoiding these problems using plain RPC systems is very
cumbersome
16 September 2008
#7
CIS 340
16 September 2008
#8
CIS 340
Transactional RPC (TRPC)
•
•
The solution to this limitation is to make RPC calls transactional,
– that is, instead of providing plain RPC, the system should provide TRPC
What is TRPC?
– same concept as RPC plus …
– additional language constructs and run time support (additional services)
to bundle several RPC calls into an atomic unit
– usually, it also includes an interface to databases for making end-to-end
transactions using the XA standard (implementing 2 Phase Commit)
– and anything else the vendor may find useful (transactional callbacks,
high level locking, etc.)
16 September 2008
#9
CIS 340
XA Protocol
# 10
TP
monitor
TM
XA
TM
XA
database
11 September 2008
TM
database
• Describes how DB
should interact in a
distributed environment
• XA compliant is attribute
of all major open DB
systems
• “Tuxedo” (orig. AT&T; BEA Inc.)
• “Encina” (IBM absorbed)
• “CICS” (IBM)
client
CIS 340
Transaction Monitor (TP-M)
• Software for controlling a transaction server
• Thread allocation from available pool of
threads
• Acts as intermediary between client, server,
and resource managers
e.g. DBMS
Since capacity available…
• Performs systems management
• Handles transaction security
• May route messages based on content
11 September 2008
# 11
CIS 340
TP-Monitors = Transactional RPC
• Extends transactional behavior beyond the
database domain
• Provides the mechanisms and tools necessary
to give transactional guarantees via
applications
• Are, perhaps, the best, oldest, and most
complex example of middleware
• Have traditionally been associated with the
mainframe world
Further,
– Their functionality has been incorporated
into most middleware tools
16 September 2008
# 12
CIS 340
“Encapsulating an RPC within
Transactional Brackets” (p. 49)
client
1. BOT
4. procedure call
10. EOT
client
process
server
9. procedure
client stub
2.register txn & create context
5.add txn id & context to call
11.request commit
14.confirm termination
server stub
6. extract context and txn id
7. register server for txn
13. participate in 2PC
3. create txn id
8. lookup txn id
register txn
register server for txn
register client for txn
return txn id
12. lookup txn id
run 2PC
notify client of outcome
transaction manager
Copyright Springer Verlag Berlin Heidelberg 2004
16 September 2008
server
process
# 13
CIS 340
TP-Heavy vs. TP-Light = 2 tier vs. 3 tier
TP-Lite:
– “Database
extension”
– No provided
development
environment
– Implemented
as threads, not
processes
– Based on
stored
procedures,
triggers
TP-Heavy:
–A full development
environment
–Additional services
•
•
•
•
•
•
16 September 2008
persistent queues
transactional services
priority scheduling
buffering
authentication
own solutions for
“operating systems
tasks”
– communication
– replication
– load balancing
– storage
management
•
# 14
Arose as
databases
provided more
services
CIS 340
Def:
"methods"
stored in the
database
To perform
an explicit
data task
TP-Heavy vs. TP-Light = 2 tier vs. 3 tier
TP-Heavy:
TP-Lite:
Main purpose?
Main purpose?
•
To provide
transactional RPC
To provide
an execution
environment
for resource
managers (e.g.
applications)
with guaranteed
reasonable
performance
“traditional”
• .....CICS, Encina,
Tuxedo
16 September 2008
# 15
•
Complex query implemented
as a stored procedure
• client “invoked” the
stored procedure, not
running the query
• transaction == stored
procedure
•
stored procedure
languages:
• Sybase's TransactSQL
• Oracle's PL/SQL.
CIS 340
Databases as a 2 Tier Approach
client
database management system
Capabilities (tools) needed
in the DBMS?
database
developing
environment
•
•
•
•
•
user defined
application
logic
database
What if business logic
requiring data resided
IN the database?
Not just the data....
external
application
Triggers
Replication
Stored procedures
Queuing systems
Standard access interfaces
EX:
ODBC, JDBC
resource manager
16 September 2008
# 16
CIS 340
CORBA
Common Object Request
Broker Architecture
•
Key parts:
– Object Request Broker (ORB)
• in charge of the interaction
between components
– CORBA services
• Standard definitions of
system services
– Standardized IDL language
• for publication of interfaces
– Protocols for allowing ORBs to
talk to each other
HISTORY?
• An attempt to modernize RPC
How?
• Object orientation
• Defined, shared standard
defined via IDL
Client
(CORBA
object)
accepted
standard
Server
(CORBA
object)
client
stub
(proxy)
interface
to remote calls
server
stub
(skeleton)
Marshalling
serialization
CORBA
Basic
Object
Adaptor
CORBA
library
Object Request Broker (ORB)
In charge of
component
interactions
CORBA
services
Standardized
definition of
services
CORBA Follows the RPC Model, But Better
Development
Like RPC:
– Define the services using
IDL
– Compile the definition
using an IDL compiler
– Client stub produced
– Method signatures
services
stored in an interface
repository
– Program the client and link
it with its stub
– Program the server and
link it with its stub
How?
RPC
Is an inter-process
communication
mechanism
CORBA
Is a reference
architecture that
includes an interprocess
communication
mechanism
16 September 2008
Unlike RPC:
– Stubs are independent of
operating system and a
programming language
# 18
CIS 340
Objects Everywhere: IIOP and GIOP
ORBs maintain
correspondence between
object reference and
“actual” object location
•
•
Client
(CORBA
object)
ORB 1
CORBA-compliant ORBs use the
General Inter-ORB Protocol
(GIOP)
Internet Inter-ORB Protocol
(IIOP) specifies how GIOP
messages are translated into
TCP/IP
Rational idea........
however too late
However
Superseded by Web services
16 September 2008
Server
(CORBA
object)
ORB 2
GIOP
GIOP
IIOP
IIOP
Internet (TCP/IP)
# 19
CIS 340
Best Of Two Worlds: Object Monitors
MW is a Evolving technology
NOT competing technology
Complementing technology
OBJECT REQUEST BROKERS (ORBs):
•
•
Reuse and distribution of components via a standard
• Object oriented interface
Various services/methods to enhance component interaction
• add semantics to the interaction between components
TRANSACTION PROCESSING MONITORS:
• An environment
• Focus upon transactional interaction
# 20
• Offers
tools necessary to achieve
ACID
16 September
2008
CIS 340
Best Of Two Worlds: Object Monitors
Evolving technology
NOT competing technology
Complementing technology
How about ………Object Transaction Monitors?
Object Monitor = ORB + TP-Monitor
16 September 2008
# 21
CIS 340
Message-Based Interaction
Advantages
• Better than synchronous systems
• Particularly for lagged business interactions
• Less of a client server flavor
• More of an exchange of information between
partners
• Affects how the interactions become / realize
interconnected business processes
• If standardized messages,
• Then off-the-shelf systems can be created that
can process such messages
• Core paradigm behind new wave interactions of
web
services
Sounds like goal
of EDI
???
………..Yes, but ………..
technology had not been there
16 September 2008
# 22
CIS 340
Message-Based Interaction:
Message?
Generally
• An information unit
• System sends to the user or system operator
About the status of an operation, an error, or other
condition
•
As telecommunication or data access methods
• The unit of information or data
• Transmitted from one program or user to another
In messaging paradigm
•
•
16 September 2008
The formal exchange of event notification, requests, or
replies between programs through a messaging server
• It is the data in a specified format
Describes an event, a request, or a reply between programs
# 23
CIS 340
Message Brokers
•
•
•
•
•
•
Advanced queuing systems
Capable of associating application logic to a queue
Queues no longer passive transmitter of messages
Active process transform or move the message based
on business rules defined queue
Business processes == Message sequences
Paradigm to promote enterprise application integration (EAI)
NOTE: Queuing management systems (QMS)
• Implement queues
• Move messages
• No business logic attached
Application logic
BUT …. Enable asynchronous interaction
Message Broker
adapter
adapter
adapter
APP 1
APP 1
APP 1
16 September 2008
adapter adapter
APP 1
APP 1
# 24
CIS 340
EAI
•
•
•
•
An integration framework composed of a collection of technologies and services which form
a middleware to enable integration of systems and applications across the enterprise.
Examples
– Supply chain management applications (for managing inventory and shipping),
– Customer relationship management applications (for managing current and potential
customers), business intelligence applications (for finding patterns from existing data from
operations),
– and other types of applications (for managing data such as human resources data, health
care, internal communications, etc.) typically cannot communicate with one another in order
to share data or business rules.
Problem
– This lack of communication leads to inefficiencies, wherein identical data are stored in
multiple locations, or straightforward processes are unable to be automated.
Solution
– EAI is the process of linking such applications within a single organization together in order
to simplify and automate business processes to the greatest extent possible, while at the
same time avoiding having to make sweeping changes to the existing applications or data
structures.
16 September 2008
# 25
CIS 340
Message Brokers Across Organizations
Application logic
Message broker
adapter
adapter
adapter
adapter
adapter
APP 1
APP 1
APP 1
APP 1
APP 1
Application logic
Message broker
adapter
adapter
adapter
adapter
adapter
APP 1
APP 1
APP 1
APP 1
APP 1
16 September 2008
# 26
CIS 340
Message Brokers: Limitations
Very efficient and very flexible infrastructures for EAI
IF
•
•
•
•
16 September 2008
messages are not too big
granularity has to be fine
mapping business process queues
is well understood and well documented
# 27
CIS 340
“Old-Fashioned” E-Commerce ...
16 September 2008
# 28
CIS 340
“Query
Price and
Availability”
SEE: http://www.ebxml.org/geninfo.htm
For ebXML …electronic business
Conventional Middleware Today
(p1/2)
RPC
• Core of any middleware platform
• Even if asynchronous interaction
HOWEVER …… part of the low level infrastructure and it is
rarely used directly by application developers
TP-Monitors
• Still important
NOW …… components in larger systems
hidden behind additional layers
base for enterprise application integration (EAI)
functionality migrating to the low levels of the
infrastructure
becoming invisible to the developer
16 September 2008
# 30
CIS 340
Conventional Middleware Today
(p2/2)
CORBA
•
Being replaced by other platforms
•
“Good aspects” being carried into new MW
Inhibiting emerging technologies:
1. Quick adoption of Java & Java Virtual Machine
2. Emergence of Internet and web
3. Rise J2EE and related technologies
acceptance for web MW
16 September 2008
# 31
CIS 340
Middleware Convergence to “Ideal”
•
In practice, MANY
types of middleware
needed
•
Various products need
to be understood
based on their
capability
• Existing systems
implement a great deal
of overlapping
functionality: what in
CORBA are called the
services
16 September 2008
“Ideal” System
transaction
object
management management
process
management
message
management
data
management
COMMON INFRASTRUCTURE
# 32
CIS 340
Highlights
• That’s a lot of technology for 30
years? (1980s)
The term middleware first
appeared “in the famous
report of the 1968 NATO
Software Engineering
Conference:
16 September 2008
# 33
CIS 340
A different perspective
• Read Ch. 10 (dbms-text)
• Read website
Starbucks Does Not Use TwoPhase Commit
•
16 September 2008
http://www.enterpriseintegrationpatterns.com/ramblings/18_
starbucks.html
# 35
CIS 340
Transactional Properties:
ACID Test
CLIENT
CLIENT
SERVER
If several components must come
together for a process, then each
atomic process operates
correctly or entire combination
aborts
C onsistency:
A service is correct when
executed in its entirety and false
or incorrect data is not
introduced into the component
databases
services
user
program
A tomicity:
transactional
coordination
I solation:
If several clients request the
same service at the same time
and access the same data, the
overall result will be as if they
were alone – isolated -- in the
system
TP-Monitor
D urability:
Application 1
16 September 2008
Application 2
Completed transactions are complete
and durable (have duration?)
If necessary, redoing and undoing
of changes in case of failures can
occur
Application 3
# 37
CIS 340