Gustavo Alonso and Cesare Pautasso Computer Science Department

Slides:



Advertisements
Similar presentations
DISTRIBUTED COMPUTING PARADIGMS
Advertisements

Database System Concepts and Architecture
Distributed Systems Major Design Issues Presented by: Christopher Hector CS8320 – Advanced Operating Systems Spring 2007 – Section 2.6 Presentation Dr.
Chapter 13 Review Questions
Database Architectures and the Web
RPC Robert Grimm New York University Remote Procedure Calls.
Message Queues COMP3017 Advanced Databases Dr Nicholas Gibbins –
Software Connectors Software Architecture. Importance of Connectors Complex, distributed, multilingual, modern software system functionality and managing.
Seminar „Web Services“
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
Distributed components
Technical Architectures
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
Chapter 1: Distributed Information Systems
Software Connectors. Attach adapter to A Maintain multiple versions of A or B Make B multilingual Role and Challenge of Software Connectors Change A’s.
Software Engineering and Middleware: a Roadmap by Wolfgang Emmerich Ebru Dincel Sahitya Gupta.
EEC-681/781 Distributed Computing Systems Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
4/25/ Application Server Issues for the Project CSEP 545 Transaction Processing for E-Commerce Philip A. Bernstein Copyright ©2003 Philip A. Bernstein.
Message-Oriented Communication Synchronous versus asynchronous communications Message-Queuing System Message Brokers Example: IBM MQSeries 02 – 26 Communication/2.4.
THE NEXT STEP IN WEB SERVICES By Francisco Curbera,… Memtimin MAHMUT 2012.
Chapter 1: Distributed Information Systems Gustavo Alonso Computer Science Department Swiss Federal Institute of Technology (ETHZ)
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 12 Slide 1 Distributed Systems Architectures.
Database Architectures and the Web Session 5
Client Server Technologies Middleware Technologies Ganesh Panchanathan Alex Verstak.
9/5/2012ISC329 Isabelle Bichindaritz1 Web Database Environment.
Lecture 15 Introduction to Web Services Web Service Applications.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Distributed Systems: Concepts and Design Chapter 1 Pages
Unit – I CLIENT / SERVER ARCHITECTURE. Unit Structure  Evolution of Client/Server Architecture  Client/Server Model  Characteristics of Client/Server.
1 Introduction to Middleware. 2 Outline What is middleware? Purpose and origin Why use it? What Middleware does? Technical details Middleware services.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
Based on the paper “Myths around Web Services” by Gustavo Alonso Web Services & Myths Around it Debashis Roy Deepa Saha.
9 September 2008CIS 340 # 1 Topics reviewTo review the communication needs to support the architectures variety of approachesTo examine the variety of.
1 Software Design Overview Reference: Software Engineering, by Ian Sommerville, Ch. 12 & 13.
Middleware for FIs Apeego House 4B, Tardeo Rd. Mumbai Tel: Fax:
Advanced Computer Networks Topic 2: Characterization of Distributed Systems.
AUTHORS: MIKE P. PAPAZOGLOU WILLEM-JAN VAN DEN HEUVEL PRESENTED BY: MARGARETA VAMOS Service oriented architectures: approaches, technologies and research.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Enterprise Integration Patterns CS3300 Fall 2015.
Shuman Guo CSc 8320 Advanced Operating Systems
Kemal Baykal Rasim Ismayilov
Seminar on Service Oriented Architecture Distributed Systems Architectural Models From Coulouris, 5 th Ed. SOA Seminar Coulouris 5Ed.1.
Web Services An Introduction Copyright © Curt Hill.
IBM Global Services © 2005 IBM Corporation SAP Legacy System Migration Workbench| March-2005 ALE (Application Link Enabling)
1 SERVICE ORIENTED ARCHITECTURE ANTHONY GACHANGO D61/70547/2008 DIS 601.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
A service Oriented Architecture & Web Service Technology.
SAP Integration with Oracle 11g Muhammad Raza Fatmi.
6. Application Server Issues for the Project
Chapter 1: Distributed Information Systems
Sabri Kızanlık Ural Emekçi
Software Connectors.
Distribution and components
Chapter 9 – RPCs, Messaging & EAI
CHAPTER 3 Architectures for Distributed Systems
Database Architectures and the Web
#01 Client/Server Computing
Ch > 28.4.
Inventory of Distributed Computing Concepts
Chapter 6 – Architectural Design
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Enterprise Integration
Database System Architectures
Lecture 7: RPC (exercises/questions)
#01 Client/Server Computing
Presentation transcript:

Web Services - Concepts, Architecture and Applications Part 3: Asynchronous middleware Gustavo Alonso and Cesare Pautasso Computer Science Department ETH Zürich alonso@inf.ethz.ch http://www.inf.ethz.ch/~alonso

Message oriented middleware ©ETH Zürich

Queues in TP-Monitors Any synchronous middleware introduces a tight coupling between the caller and the called. Name and directory services help to minimize the effects of this coupling but the tight connection between components is nevertheless there. It also creates considerable problems when trying to implement certain properties or manage the interaction between client and servers (fault tolerance, availability, etc.) The first systems to provide alternatives were TP-Monitors which offered two choices: asynchronous RPC: client makes a call that returns immediately; the client is responsible for making a second call to get the results Reliable queuing systems (e.g., Encina, Tuxedo) where, instead of using procedure calls, client and server interact by exchanging messages. Making the messages persistent by storing them in queues added considerable flexibility to the system client service call get results server service return results Client stub Server stub RPC support Input queue Output queue Reliable queuing system external application Output queue Input queue external application ©ETH Zürich

Queues in practice To access a queue, a client or a server uses the queuing services, e.g., : put (enqueue) to place a message in a given queue get (dequeue) to read a message from a queue mput to put a message in multiple queues transfer a message from a queue to another In TP-Monitors, these services are implemented as RPC calls to an internal resource manager (the reliable queuing service) These calls can be made part of transaction using the same mechanisms of TRPC (the queuing system uses an XA interface and works like any other resource manager) client put … Client stub (queuing service) put get mput persistent repository queue management Queuing server server get … Client stub (queuing service) ©ETH Zürich

Reliable queuing Reliable queuing turned out to be a very good idea and an excellent complement to synchronous interactions: Suitable to modular design: the code for making a request can be in a different module (even a different machine!) than the code for dealing with the response It is easier to design sophisticated distribution modes (multicast, transfers, replication, coalescing messages) and it also helps to handle communication sessions in a more abstract way More natural way to implement complex interactions request() queue receive process return queue do with answer ©ETH Zürich

Queuing systems Queuing systems implement asynchronous interactions. Each element in the system communicates with the rest via persistent queues. These queues store messages transactionally, guaranteeing that messages are there even after failures occur. Queuing systems offer significant advantages over traditional solutions in terms of fault tolerance and overall system flexibility: applications do not need to be there at the time a request is made! Queues provide a way to communicate across heterogeneous networks and systems while still being able to make some assumptions about the behavior of the messages. They can be used when embedded (workflow, TP-Monitors) or by themselves (MQSeries, Tuxedo/Q). client Input queue Output queue Reliable queuing system Monitoring Administration Persistent storage Input queue Output queue external application ©ETH Zürich

Transactional queues Persistent queues are closely tied to transactional interaction: to send a message, it is written in the queue using 2PC messages between queues are exchanged using 2PC reading a message from a queue, processing it and writing the reply to another queue is all done under 2PC This introduces a significant overhead but it also provides considerable advantages. The overhead is not that important with local transactions (writing or reading to a local queue). Using transactional queues, the processing of messages and sending and receiving can be tied together into one single transactions so that atomicity is guaranteed. This solves a lot of problems! external application 2PC 2PC Output queue Input queue 2PC 2PC Input queue Output queue 2PC external application ©ETH Zürich

Problems solved (I) Message is now persistent. If the node SENDING RECEIVING external application external application 2PC 2PC Message is now persistent. If the node crashes, the message remains in the queue. Upon recovery, the application can look in the queue and see which messages are there and which are not. Multiple applications can write to the same queue, thereby “multiplexing” the channel. Arriving messages remain in the queue. If the node crashes, messages are not lost. The application can now take its time to process messages. It is also possible for several applications to read from the same queue. This allows to implement replicated services, do load balancing, and increase fault tolerance. ©ETH Zürich

Message is either read or written Problems solved (II) An application can bundle within a single transaction reading a message from a queue, interacting with other systems, and writing the response to a queue. If a failure occurs, in all scenarios consistency is ensured: if the transaction was not completed, any interaction with other applications is undone and the reading operation from the input queue is not committed: the message remains in the input queue. Upon recovery, the message can be processed again, thereby achieving exactly once semantics. If the transaction was completed, the write to the output queue is committed, i.e., the response remains in the queue. If replicated services are used, if one fails and the message remains in the input queue, it is safe for other services to take over this message. Input queue Output queue 2PC external application Message is either read or written Input queue Output queue 2PC external application ©ETH Zürich

Implementation Persistent queues can be implemented as part of a database since the functionality needed is exactly that of a database: a transactional interface persistence of committed transactions advanced indexing and search capabilities Thus, messages in a queue become simple entries in a table. These entries can be manipulated like any other data in a database so that applications using the queue can assign priorities, look for messages with given characteristics, trigger certain actions when messages of a particular kind arrive … external application Output queue Input queue MSSG QUEUE m1 q1 m2 q3 m3 q7 m6 q5 m4 q1 m5 q1 ©ETH Zürich

Advantages of queues in EAI Queuing management systems completely detach the two sides of an interaction as there is no direct call but a document exchange This makes the development of both sides of the interaction (e.g., client and server) completely independent and very flexible The interaction can be defined in terms of the document to exchange rather than the interface to invoke. This is a more natural approach in the business world where interactions tend to be document based From the scheduling point of view, it is much easier to deal with messages than with synchronous invocations. Technically, the infrastructure necessary to deal with messages is simpler than the infrastructure necessary to deal with synchronous calls. Especially if there are no fancy features added to the queues. Queues also have the advantage of being easily adaptable to communicate with external systems, even systems outside the organization (e.g., plug a queue to an e-mail address) When working with messages, the effort in describing the interaction goes into the description of the message or document within the message. This can be done without knowledge of how the message will be processed. ©ETH Zürich

Message brokers Message broker Queuing management systems take care only of implementing queues and moving messages from one place to another. It is not possible to associate any logic to the queues. Message brokers are advanced queuing systems that are capable of associating application logic to the queues so that the queues no longer act as passive transmitter of messages but can actively process, transform, or route the message according to business rules associated with the queue. Plain queuing systems allow to implement asynchronous interaction. Message brokers allow to transform business processes into sequence of message exchanges between different applications, exactly what is needed for EAI. Application logic Message broker adapter adapter adapter adapter adapter APP 1 APP 1 APP 1 APP 1 APP 1 ©ETH Zürich

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 ©ETH Zürich

Limitations of message brokers Message brokers are very efficient and very flexible infrastructures for EAI provided: messages are not too big (granularity has to be fine) the mapping business process -> queues is well understood and well documented If one of these two constraints are not observed, problems might arise: The implementation of queuing systems and message brokers is largely still based on the same technology as conventional middleware (RPC). Such procedural or method interfaces are not made for passing large objects (e.g., a large document) but mostly basic types and references. If data flow is through references, it is outside the control of the system and some properties may be difficult to enforce (reliability, transactions, etc.) Associating logic to the queue can be very helpful in many applications but distributing the logic of a business process across many queues makes the process very difficult to understand and there might not be a global description of the process. Usually, it is not a good idea to use a message broker in the same way one would use a workflow engine due to the lack of global view over what is happening. ©ETH Zürich

Message oriented business exchanges ©ETH Zürich

Old fashioned e-commerce ... ©ETH Zürich

… WHICH IS NOW WIDELY USED AND EXPANDING Using Workflows with ebXML ©BEA … WHICH IS NOW WIDELY USED AND EXPANDING ©ETH Zürich

Message based interaction Message based interaction has several advantages over synchronous systems, particularly when the interaction involves different organizations and typical business transactions (where the response might not be immediate). Message based interaction has less of a client server flavor and more of an exchange of information between partners, this affects not only the way the interaction is implemented (as interconnected business processes) but also the technology used for that purpose. If the messages are standardized, then it is possible to create off-the-shelf systems that can process such messages. This was the original goal of EDI but the technology was not yet there. The Internet, XML, and the whole notion of Web services will probably now help to make this goal a reality at a lower cost and with less effort than was required before. Message based interaction is behind many of the most comprehensive models for electronic commerce (ebXML, xCBL, etc.) and will certainly have a decisive influence on how SOAP, WSDL and UDDI will evolve in the future. ©ETH Zürich