Message Queues COMP3017 Advanced Databases Dr Nicholas Gibbins – 2012-2013.

Slides:



Advertisements
Similar presentations
MQ Series Cross Platform Dominant Messaging sw – 70% of market Messaging API same on all platforms Guaranteed one-time delivery Two-Phase Commit Wide EAI.
Advertisements

DISTRIBUTED COMPUTING PARADIGMS
Welcome to Middleware Joseph Amrithraj
Categories of I/O Devices
Unit – Paradigms and Abstraction 3.2 An Example Applications 3.3 Paradigms for Distributed Applications Distributed Computing Paradigms By Asst.
Remote Procedure Call (RPC)
CCNA – Network Fundamentals
Chapter 3: Programming Web Services Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005.
28.2 Functionality Application Software Provides Applications supply the high-level services that user access, and determine how users perceive the capabilities.
Internet Networking Spring 2006 Tutorial 12 Web Caching Protocols ICP, CARP.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
Page: 1 Director 1.0 TECHNION Department of Computer Science The Computer Communication Lab (236340) Summer 2002 Submitted by: David Schwartz Idan Zak.
Introduction to z/OS Basics © 2006 IBM Corporation Chapter 15: WebSphere MQ.
1 ICS 214B: Transaction Processing and Distributed Data Management Lecture 15: Data Replication with Network Partitions & Transaction Processing Systems.
Middleware Technologies compiled by: Thomas M. Cosley.
2/27/ Queued Transaction Processing CSE593 Transaction Processing Philip A. Bernstein Copyright ©1999 Philip A. Bernstein.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 17 Client-Server Processing, Parallel Database Processing,
Click to add text Introduction to z/OS Basics © 2006 IBM Corporation Chapter 15: WebSphere MQ.
September 2011 At A Glance The API provides a common interface to the GMSEC software information bus. Benefits Isolates both complexity of applications.
4/25/ Application Server Issues for the Project CSEP 545 Transaction Processing for E-Commerce Philip A. Bernstein Copyright ©2003 Philip A. Bernstein.
Fundamentals of Python: From First Programs Through Data Structures
Message-Oriented Communication Synchronous versus asynchronous communications Message-Queuing System Message Brokers Example: IBM MQSeries 02 – 26 Communication/2.4.
Distributed Databases
Lecture slides prepared for “Business Data Communications”, 7/e, by William Stallings and Tom Case, Chapter 8 “TCP/IP”.
Overview SAP Basis Functions. SAP Technical Overview Learning Objectives What the Basis system is How does SAP handle a transaction request Differentiating.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
InterSwyft Technology presentation. Introduction InterSwyft brings secured encrypted transmission of SMS messages for internal and external devices such.
WORKFLOW IN MOBILE ENVIRONMENT. WHAT IS WORKFLOW ?  WORKFLOW IS A COLLECTION OF TASKS ORGANIZED TO ACCOMPLISH SOME BUSINESS PROCESS.  EXAMPLE: Patient.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
思科网络技术学院理事会. 1 Application Layer Functionality and Protocols Network Fundamentals – Chapter 3.
1 Telematica di Base Applicazioni P2P. 2 The Peer-to-Peer System Architecture  peer-to-peer is a network architecture where computer resources and services.
SAP Overview SAP? Company ERP Software package –R/2 –R/3.
Networks QUME 185 Introduction to Computer Applications.
Introduction  Client/Server technology is seen by many as the solution to the difficulty of linking together the various departments of corporation.
Unit – I CLIENT / SERVER ARCHITECTURE. Unit Structure  Evolution of Client/Server Architecture  Client/Server Model  Characteristics of Client/Server.
(Business) Process Centric Exchanges
Messaging is an important means of communication between two systems. There are 2 types of messaging. - Synchronous messaging. - Asynchronous messaging.
DISTRIBUTED COMPUTING PARADIGMS. Paradigm? A MODEL 2for notes
SEMINOR. INTRODUCTION 1. Middleware is connectivity software that provides a mechanism for processes to interact with other processes running on multiple.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
© Lethbridge/Laganière 2005 Chap. 3: Basing Development on Reusable Technology The Client-Server Architecture A distributed system is a system in.
9 Systems Analysis and Design in a Changing World, Fourth Edition.
Lecture 6: Sun: 8/5/1435 Distributed Applications Lecturer/ Kawther Abas CS- 492 : Distributed system & Parallel Processing.
Multimedia and Networks. Protocols (rules) Rules governing the exchange of data over networks Conceptually organized into stacked layers – Application-oriented.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
Message Queuing Middleware Message queuing is asynchronous communication Most distributed apps use synchronous communication –Sender must wait for response.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 15 WebSphere MQ.
Data Communications and Networks Chapter 9 – Distributed Systems ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
Enterprise Network Systems TCP Mark Clements. 3 March 2008ENS 2 Last Week – Client/ Server Cost effective way of providing more computing power High specs.
IBM Global Services © 2005 IBM Corporation SAP Legacy System Migration Workbench| March-2005 ALE (Application Link Enabling)
SPI NIGHTLIES Alex Hodgkins. SPI nightlies  Build and test various software projects each night  Provide a nightlies summary page that displays all.
1 EPICS Flow of Control: EPICS Workshop at IHEP, Beijing, August 2001 EPICS Flow of Control Marty Kraimer APS.
Multimedia Retrieval Architecture Electrical Communication Engineering, Indian Institute of Science, Bangalore – , India Multimedia Retrieval Architecture.
1 Network Communications A Brief Introduction. 2 Network Communications.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
6. Application Server Issues for the Project
MQ Series Cross Platform Dominant Messaging sw – 70% of market
Chapter 9: Transport Layer
Instructor Materials Chapter 9: Transport Layer
Chapter 9 – RPCs, Messaging & EAI
Software models - Software Architecture Design Patterns
Service-Oriented Computing: Semantics, Processes, Agents
Internet Protocols IP: Internet Protocol
William Stallings Data and Computer Communications
Message Queuing.
MQ Series Cross Platform Dominant Messaging sw – 70% of market
Chapter 5 Architectural Design.
Message Queuing and Asynchronous Inter Process Communication
Presentation transcript:

Message Queues COMP3017 Advanced Databases Dr Nicholas Gibbins –

Transactions Revisited 2 Complete units of work – ACID Transactions may be distributed across more than one processor –Dedicated link between programs –Operations synchronized –Distributed two phase commit Many transactions need not be completed synchronously –Communication must still be guaranteed –Work can be completed later

Synchronous versus Asynchronous 3 HTTP is a synchronous protocol –Request from client to server is followed by reply from server to client in the same TCP connection SMTP is an asynchronous protocol – messages are sent on a store-and-forward basis –Final message recipient need not be available when message is sent

Messaging and Queuing (MQ) 4 MQ enables programs to communicate across a network asynchronously –No private, dedicated link required –Systems can be heterogeneous –Message delivery is guaranteed Messages are placed on queues by one system and taken off by another –Similar idea to , but more sophisticated mechanism MQ can also be used between programs running on the same system

Direct Transaction Processing 5 Conventional (direct) transaction processing has weaknesses: –Designed for synchronous processing –Has difficulties with long-lived transactions and communication errors –Difficult to balance loads between several servers carrying out the same tasks –Difficult to prioritise one request over another

6 If server is down, client does not receive an immediate answer Cannot distinguish between: –request not delivered to server –server failure –reply not delivered to client Direct TP Problems: Server Failure ClientServer

7 Cannot tell if response has been received by client Direct TP Problems: Client Failure ClientServer

8 Cannot ensure that servers carrying out a task have an even load Direct TP Problems: Unbalanced Load Server 1 Server 2Server 3 requests

9 Tasks handled on a first-come, first-served basis; cannot process high-priority requests early Direct TP Problems: No Prioritisation Server ! requests urgent request

10 Client adds request to queue (enqueues) Server removes request from queue (dequeues) If server is unavailable (busy, down, disconnected), the request is stored in the queue until the server is able to process it Message Queues ClientServer message queue enqueue request dequeue request

11 Bidirectional communication between client and server requires a separate queue for communications in each direction Bidirectional Queues ClientServer request queue enqueue request dequeue request reply queue enqueue reply dequeue reply

12 Communication may be one-to-many Communication may be many-to-one Application Structure Client Server message queue Server Client message queue Server Client

13 When a server finishes processing a request, it takes the next from the queue Load Balancing ClientServer message queue enqueue dequeue ClientServer

Queued Transaction Processing 14 transaction start dequeue(request queue) process request enqueue(reply queue) commit request queue reply queue

Queued Transaction Processing 15 If transaction aborts: –request returned to input queue –changes made by transaction are rolled back –if necessary, reply removed from output queue Repeated aborts (due to a poisoned message) may be prevented with a maximum limit on retries

Queued Transaction Processing 16 transaction 1: submit request start construct request enqueue(request queue) commit transaction 3: process reply start dequeue(reply queue) process output commit transaction 2: execute request start dequeue(request queue) process request enqueue(reply queue) commit client server request queue reply queue

Message Ordering 17 Description of message queues so far does not consider how messages are ordered in a queue –First-come, first-served –Highest-priority-first Aborted transactions may lead to out-of-order processing: –T1 dequeues M1 –T2 dequeues M2 –T2 commits –T1 aborts, returns M1 to queue

Benefits Simple APIs hide communications complexity Fewer constraints on inter-program operation –Programs communicate indirectly – asynchronous –Client and server do not need to be running at the same time Fewer network sessions needed, and programs are less vulnerable to network failures Business change easier to handle Assured message delivery Asynchronous transaction processing 18

Implementations and Standards Message Queuing is not a new idea! –Used for, example, within IBM's Information Management System (IMS) 30 years ago Both proprietary and open source APIs and platforms –IBM Websphere MQ, Microsoft Message Queuing, Oracle Advanced Queuing –Apache ActiveMQ, Rabbit MQ Some products inter-operate via common standards –AMQP, MQTT 19

Example 1: Client-Server Applications 20 Insurance agents throughout the country request insurance quotations using an online system. This system is implemented as a traditional client-server application, with client programs (the insurance agents) sending requests for quotations to a central server program. The server does some calculations using data from a central insurance database, then sends a quotation to the requesting agent.

21 Client programs put request messages on a single queue, from which the server program takes them. Responses may be sent back to clients via extra message queues (one per client) Example 1: Client-Server Applications Insurance Agent message queue Insurance Quotation Insurance Agent Insurance Agent insurance data

Example 2: Output-only Devices 22 A device providing a service is output-only, and does not send messages back to the requester. Only one-way message flows are required. Output-only devices: –Printing devices –Displays:- Stock exchange, Flight arrivals and departures –Factory floor robotics

23 Robotics Controller is in control of an automated manufacturing process. It puts messages on: –Queue 1 for the Robotics A program, which directs some welding machinery, and on –Queue 2 for the Robotics B program, which controls a paint sprayer. Example 2: Output-only Devices Robotics Controller Robotics A Robotics B queue 1 queue 2

Example 3: The Batch Window 24 A department store writes its sales figures to a file throughout the day ’ s trading. Overnight, a report of the day’s sales is produced using this file of data as input. The report must be on the Sales Manager’s desk before the next day ’ s trading begins. – The amount of time available for producing the report is limited to the “ window ” of time between the end of business on one day and the start of business on the next –The start and finish times for the activity are fixed

25 Instead of operating in sequence and communicating via a file, the two programs could run independently of each other and communicate using a message queue Example 3: The Batch Window Sales Recording Sales Reporting message queue

Summary Message queuing allows an alternative way to distribute applications Many applications involve databases, so the technologies intersect Conceptually and practically, MQ is often a more straightforward approach than direct connections between systems, and synchronous transaction processing 26