SlideShare une entreprise Scribd logo
1  sur  30
1
Distributed ApplicationsDistributed Applications
Operating System CommsOperating System Comms
NetworkNetwork
Introduction to Middleware I
• What is Middleware?
– Layer between OS and distributed applications
– Hides complexity and heterogeneity of distributed system
– Bridges gap between low-level OS communications and programming
language abstractions
– Provides common programming abstraction and infrastructure for
distributed applications
– Overview at: http://www.middleware.org
Distributed Applications
Middleware
Operating System Comms
(packets, bits…)
(remote calls, object invocation,
messages, …)
(sockets, IP, TCP, UDP, …)
Network
Middleware
2
Introduction to Middleware II
• Middleware provides support for (some of):
– Naming, Location, Service discovery, Replication
– Protocol handling, Communication faults, QoS
– Synchronisation, Concurrency, Transactions, Storage
– Access control, Authentication
• Middleware dimensions:
– Request/Reply vs. Asynchronous Messaging
– Language-specific vs. Language-independent
– Proprietary vs. Standards-based
– Small-scale vs. Large-scale
– Tightly-coupled vs. Loosely-coupled components
Middleware
3
Outline
• Part I: Remote Procedure Call (RPC)
– Historic interest
• Part II: Object-Oriented Middleware (OOM)
– Java RMI
– CORBA
– Reflective Middleware
• Part III: Message-Oriented Middleware (MOM)
– Java Message Service
– IBM MQSeries
– Web Services
• Part IV: Event-Based Middleware
– Cambridge Event Architecture
– Hermes
research
research
Middleware
4
Part I: Remote Procedure Call (RPC)
• Masks remote function calls as being local
• Client/server model
• Request/reply paradigm usually implemented with
message passing in RPC service
• Marshalling of function parameters and return value
Caller RPC Service RPC Service Remote
Functio
n
call(…)
1) Marshal args
2) Generate ID
3) Start timer 4) Unmarshal
5) Record ID
6) Marshal
7) Set timer
8) Unmarshal
9) Acknowledge
fun(…)
message
Middleware
5
Properties of RPC
Language-level pattern of function call
• easy to understand for programmer
Synchronous request/reply interaction
• natural from a programming language point-of-view
• matches replies to requests
• built in synchronisation of requests and replies
Distribution transparency (in the no-failure case)
• hides the complexity of a distributed system
Various reliability guarantees
• deals with some distributed systems aspects of failure
Middleware
6
Failure Modes of RPC
• Invocation semantics supported by RPC in the light of:
network and/or server congestion,
client, network and/or server failure
note DS independent failure modes
• RPC systems differ, many examples, local was Mayflower
Exactly once (RPC system retries a few times)
• Hard error return – some failure most likely
note that “exactly once” cannot be guaranteed
Maybe or at most once (RPC system tries
once)
• Error return – programmer may retry
Middleware
7
Disadvantages of RPC
 Synchronous request/reply interaction
• tight coupling between client and server
• client may block for a long time if server loaded
leads to multi-threaded programming at client
• slow/failed clients may delay servers when replying
multi-threading essential at servers
 Distribution Transparency
• Not possible to mask all problems
 RPC paradigm is not object-oriented
• invoke functions on servers as opposed to methods on objects
fork(…)
join(…)
remote call
Middleware
8
Part II: Object-Oriented Middleware (OOM)
• Objects can be local or remote
• Object references can be local or remote
• Remote objects have visible remote interfaces
• Masks remote objects as being local using proxy objects
• Remote method invocation
object A
proxy
object B
OOM OOM
skeleton
object B
object B
local remote
object
request
broker
/
object
manager
object
request
broker
/
object
manager
Middleware
9
Properties of OOM
Support for object-oriented programming model
– objects, methods, interfaces, encapsulation, …
– exceptions (were also in some RPC systems e.g. Mayflower)
Synchronous request/reply interaction
– same as RPC
Location Transparency
– system (ORB) maps object references to locations
Services comprising multiple servers are easier to build with OOM
– RPC programming is in terms of server-interface (operation)
– RPC system looks up server address in a location service
Middleware
10
Java Remote Method Invocation (RMI)
• Covered in 1B Advanced Java programming
• Distributed objects in Java
public interface PrintService extends Remote {
int print(Vector printJob) throws RemoteException;
}
• RMI compiler creates proxies and skeletons
• RMI registry used for interface lookup
• Entire system written in Java (single-language system)
Middleware
11
CORBA
• Common Object Request Broker Architecture
– Open standard by the OMG (Version 3.0)
– Language- and platform independent
• Object Request Broker (ORB)
– General Inter-ORB Protocol (GIOP) for communication
– Interoperable Object References (IOR) contain object location
– CORBA Interface Definition Language (IDL)
• Stubs (proxies) and skeletons created by IDL compiler
– Dynamic remote method invocation
• Interface Repository
– Querying existing remote interfaces
• Implementation Repository
– Activating remote objects on demand
Middleware
12
CORBA IDL
• Definition of language-independent remote interfaces
– Language mappings to C++, Java, Smalltalk, …
– Translation by IDL compiler
• Type system
– basic types: long (32 bit),
long long (64 bit), short,
float, char, boolean,
octet, any, …
– constructed types: struct, union, sequence, array, enum
– objects (common super type Object)
• Parameter passing
– in, out, inout
– basic & constructed types passed by value
– objects passed by reference
typedef sequence<string> Files;
interface PrintService : Server {
void print(in Files printJob);
};
Middleware
13
CORBA Services (selection)
• Naming Service
– Names  remote object references
• Trading Service
– Attributes (properties)  remote object references
• Persistent Object Service
– Implementation of persistent CORBA objects
• Transaction Service
– Making object invocation part of transactions
• Event Service and Notification Service
– In response to applications‘ need for asynchronous communication
– built above synchronous communication with push or pull options
– not an integrated programming model with general IDL messages
Middleware
14
Disadvantages of OOM
 Synchronous request/reply interaction only
• So CORBA oneway semantics added and -
• Asynchronous Method Invocation (AMI)
• But implementations may not be loosely coupled
 Distributed garbage collection
• Releasing memory for unused remote objects
 OOM rather static and heavy-weight
• Bad for ubiquitous systems and embedded devices
Middleware
15
OOM experience
Keynote address at Middleware 2009
Steve Vinoski
From Middleware Implementor to Middleware User
(There and back again)
Available from the course materials page and the MW09
program on the website
Middleware
16
Reflective Middleware
• Flexible middleware (OOM) for mobile and context-aware
applications – adaptation to context through monitoring
and substitution of components
• Interfaces for reflection
– Objects can inspect middleware behaviour
• Interfaces for customisability
– Dynamic reconfiguration depending on environment
– Different protocols, QoS, ...
– e.g. use different marshalling strategy over unreliable wireless link
Middleware
17
Part III: Message-Oriented Middleware (MOM)
• Communication using messages
• Messages stored in message queues
• message servers decouple client and server
• Various assumptions about message content
Client App.
local message
queues
Server App.
local message
queues
message
queues
Network Network Network
Message
Servers
Middleware
18
Properties of MOM
Asynchronous interaction
– Client and server are only loosely coupled
– Messages are queued
– Good for application integration
Support for reliable delivery service
– Keep queues in persistent storage
Processing of messages by intermediate message server(s)
– May do filtering, transforming, logging, …
– Networks of message servers
Natural for database integration
Middleware
19
IBM MQSeries
• One-to-one reliable message passing using queues
– Persistent and non-persistent messages
– Message priorities, message notification
• Queue Managers
– Responsible for queues
– Transfer messages from input to output queues
– Keep routing tables
• Message Channels
– Reliable connections between queue managers
• Messaging API: MQopen Open a queue
MQclose Close a queue
MQput Put message into opened queue
MQget Get message from local queue
Middleware
20
Java Message Service (JMS)
• API specification to access MOM implementations
• Two modes of operation *specified*:
– Point-to-point
• one-to-one communication using queues
– Publish/Subscribe
• cf. Event-Based Middleware
• JMS Server implements JMS API
• JMS Clients connect to JMS servers
• Java objects can be serialised to JMS messages
• A JMS interface has been provided for MQ
• pub/sub (one-to-many) - just a specification?
Middleware
21
Disadvantages of MOM
 Poor programming abstraction (but has evolved)
• Rather low-level (cf. Packets)
• Request/reply more difficult to achieve, but can be done
 Message formats originally unknown to middleware
• No type checking (JMS addresses this – implementation?)
 Queue abstraction only gives one-to-one communication
• Limits scalability (JMS pub/sub – implementation?)
Middleware
22
Web Services
• Use well-known web standards for distributed computing
Communication
• Message content expressed in XML
• Simple Object Access Protocol (SOAP)
– Lightweight protocol for sync/async communication
Service Description
• Web Services Description Language (WSDL)
– Interface description for web services
Service Discovery
• Universal Description Discovery and Integration (UDDI)
– Directory with web service description in WSDL
Middleware
23
Properties of Web Services
Language-independent and open standard
SOAP offers OOM and MOM-style communication:
• Synchronous request/reply like OOM
• Asynchronous messaging like MOM
• Supports internet transports (http, smtp, ...)
• Uses XML Schema for marshalling types to/from programming
language types
WSDL says how to use a web service
UDDI helps to find the right web service
• Exports SOAP API for access
http://api.google.com/GoogleSearch.wsdl
Middleware
24
Disadvantages of Web Services
 Low-level abstraction
• leaves a lot to be implemented
 Interaction patterns have to be built
• one-to-one and request-reply provided
• one-to-many?
• still synchronous service invocation, rather than notification
• No nested/grouped invocations, transactions, ...
 No location transparency
Middleware
25
What we lack, so far
 General interaction patterns
• we have one-to-one and request-reply
• one-to-many? many to many?
• notification?
• dynamic joining and leaving?
 Location transparency
• anonymity of communicating entities
 Support for pervasive computing
• data values from sensors
• lightweight software
Middleware
26
Part IV: Event-Based Middleware a.k.a. Publish/Subscribe
• Publishers (advertise and) publish events (messages)
• Subscribers express interest in events with subscriptions
• Event Service notifies interested subscribers of published events
• Events can have arbitrary content (typed) or name/value pairs
Event Service
(event-broker
network)
Subscribe
r
Subscribe
r
Subscribe
r
Publisher
Publisher
Publisher
publish
publish
publish
subscribe
subscribe
subscribe
notify
notify
notify
Middleware
27
Topic-Based and Content-Based Pub/Sub
• Event Service matches events against subscriptions
• What do subscriptions look like?
Topic-Based Publish/Subscribe
– Publishers publish events belonging to a topic or subject
– Subscribers subscribe to a topic
subscribe(PrintJobFinishedTopic, …)
(Topic and) Content-Based Publish/Subscribe
– Publishers publish events belonging to topics and
– Subscribers provide a filter based on content of events
subscribe(type=printjobfinished, printer=‘aspen’, …)
Middleware
28
Properties of Publish/Subscribe
Asynchronous communication
• Publishers and subscribers are loosely coupled
Many-to-many interaction between pubs. and subs.
• Scalable scheme for large-scale systems
• Publishers do not need to know subscribers, and vice-versa
• Dynamic join and leave of pubs, subs, (brokers - see lecture DS-8)
(Topic and) Content-based pub/sub very expressive
• Filtered information delivered only to interested parties
• Efficient content-based routing through a broker network
Middleware
29
Composite Event Detection (CED)
• Content-based pub/sub may not be expressive enough
– Potentially thousands of event types (primitive events)
– Subscribers interest: event patterns (define high-level events, ref DS-2)
• Event Patterns
PrinterOutOfPaperEvent or PrinterOutOfTonerEvent
• Composite Event Detectors (CED)
– Subscribe to primitive events and publish composite events
Publisher
Publisher
Publisher
CED
CED
CED
Publisher
Subscribe
r
Subscribe
r
Middleware
30
Summary
• Middleware is an important abstraction for building
distributed systems
• Synchronous vs. asynchronous communication
• Scalability, many-to-many communication
• Language integration
• Ubiquitous systems, mobile systems
1. Remote Procedure Call
2. Object-Oriented Middleware
3. Message-Oriented Middleware
4. Event-Based Middleware
Middleware

Contenu connexe

Tendances

Server virtualization
Server virtualizationServer virtualization
Server virtualizationofsorganizer
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Bhavik Vashi
 
Lecture 2 more about parallel computing
Lecture 2   more about parallel computingLecture 2   more about parallel computing
Lecture 2 more about parallel computingVajira Thambawita
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemPoojaBele1
 
Remote invocation
Remote invocationRemote invocation
Remote invocationishapadhy
 
An introduction to Apache Camel
An introduction to Apache CamelAn introduction to Apache Camel
An introduction to Apache CamelKapil Kumar
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architectureYisal Khan
 
Content Delivery Networks (CDN)
Content Delivery Networks (CDN)Content Delivery Networks (CDN)
Content Delivery Networks (CDN)Dilum Bandara
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Virtualization & cloud computing
Virtualization & cloud computingVirtualization & cloud computing
Virtualization & cloud computingSoumyajit Basu
 
Introduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperIntroduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperRahul Jain
 
Containerizing a Data Warehouse for Kubernetes
Containerizing a Data Warehouse for KubernetesContainerizing a Data Warehouse for Kubernetes
Containerizing a Data Warehouse for KubernetesVMware Tanzu
 
Building large scale, job processing systems with Scala Akka Actor framework
Building large scale, job processing systems with Scala Akka Actor frameworkBuilding large scale, job processing systems with Scala Akka Actor framework
Building large scale, job processing systems with Scala Akka Actor frameworkVignesh Sukumar
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and responseSahil Agarwal
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)Amit Nirala
 

Tendances (20)

Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
 
Server virtualization
Server virtualizationServer virtualization
Server virtualization
 
Load balancing
Load balancingLoad balancing
Load balancing
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
 
Lecture 2 more about parallel computing
Lecture 2   more about parallel computingLecture 2   more about parallel computing
Lecture 2 more about parallel computing
 
An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1An Introduction to OMNeT++ 5.1
An Introduction to OMNeT++ 5.1
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
 
Remote invocation
Remote invocationRemote invocation
Remote invocation
 
An introduction to Apache Camel
An introduction to Apache CamelAn introduction to Apache Camel
An introduction to Apache Camel
 
Distributed Computing
Distributed ComputingDistributed Computing
Distributed Computing
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
What is Virtualization
What is VirtualizationWhat is Virtualization
What is Virtualization
 
Content Delivery Networks (CDN)
Content Delivery Networks (CDN)Content Delivery Networks (CDN)
Content Delivery Networks (CDN)
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Virtualization & cloud computing
Virtualization & cloud computingVirtualization & cloud computing
Virtualization & cloud computing
 
Introduction to Kafka and Zookeeper
Introduction to Kafka and ZookeeperIntroduction to Kafka and Zookeeper
Introduction to Kafka and Zookeeper
 
Containerizing a Data Warehouse for Kubernetes
Containerizing a Data Warehouse for KubernetesContainerizing a Data Warehouse for Kubernetes
Containerizing a Data Warehouse for Kubernetes
 
Building large scale, job processing systems with Scala Akka Actor framework
Building large scale, job processing systems with Scala Akka Actor frameworkBuilding large scale, job processing systems with Scala Akka Actor framework
Building large scale, job processing systems with Scala Akka Actor framework
 
HTTP request and response
HTTP request and responseHTTP request and response
HTTP request and response
 
What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)What is Server? (Web Server vs Application Server)
What is Server? (Web Server vs Application Server)
 

Similaire à middleware

Chapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptxChapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptxmeharikiros2
 
The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices ArchitectureParia Heidari
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed SystemsDilum Bandara
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed applicationRishikese MR
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance SHIKHA GAUTAM
 
Manish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareManish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareA P
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and modelsMayank Jain
 
Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Benjamin Cabé
 
Monolithic to Microservices Architecture
Monolithic to Microservices ArchitectureMonolithic to Microservices Architecture
Monolithic to Microservices ArchitectureVin Dahake
 
remote method invocation
remote method invocationremote method invocation
remote method invocationRavi Theja
 
IBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platformsIBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platformsMarkTaylorIBM
 
Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with SpringSam Brannen
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYreginamutio48
 
IBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platformsIBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platformsMarkTaylorIBM
 

Similaire à middleware (20)

Middleware
MiddlewareMiddleware
Middleware
 
Mq Lecture
Mq LectureMq Lecture
Mq Lecture
 
4. system models
4. system models4. system models
4. system models
 
Chapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptxChapter-1-IntroDistributeddffsfdfsdf-1.pptx
Chapter-1-IntroDistributeddffsfdfsdf-1.pptx
 
The Overview of Microservices Architecture
The Overview of Microservices ArchitectureThe Overview of Microservices Architecture
The Overview of Microservices Architecture
 
Ead pertemuan-7
Ead pertemuan-7Ead pertemuan-7
Ead pertemuan-7
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed Systems
 
Middleware and Middleware in distributed application
Middleware and Middleware in distributed applicationMiddleware and Middleware in distributed application
Middleware and Middleware in distributed application
 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
 
Manish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middlewareManish tripathi-e-commerce-middleware
Manish tripathi-e-commerce-middleware
 
Ds objects and models
Ds objects and modelsDs objects and models
Ds objects and models
 
Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013Open source building blocks for the Internet of Things - Jfokus 2013
Open source building blocks for the Internet of Things - Jfokus 2013
 
Monolithic to Microservices Architecture
Monolithic to Microservices ArchitectureMonolithic to Microservices Architecture
Monolithic to Microservices Architecture
 
6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF6. The grid-COMPUTING OGSA and WSRF
6. The grid-COMPUTING OGSA and WSRF
 
remote method invocation
remote method invocationremote method invocation
remote method invocation
 
IBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platformsIBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platforms
 
Composable Software Architecture with Spring
Composable Software Architecture with SpringComposable Software Architecture with Spring
Composable Software Architecture with Spring
 
Mini-Training: Message Brokers
Mini-Training: Message BrokersMini-Training: Message Brokers
Mini-Training: Message Brokers
 
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGYDistributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
Distributed OPERATING SYSTEM FOR BACHELOR OF BUSINESS INFORMATION TECHNOLOGY
 
IBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platformsIBM MQ - Comparing Distributed and z/OS platforms
IBM MQ - Comparing Distributed and z/OS platforms
 

Dernier

Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 

Dernier (20)

Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 

middleware

  • 1. 1 Distributed ApplicationsDistributed Applications Operating System CommsOperating System Comms NetworkNetwork Introduction to Middleware I • What is Middleware? – Layer between OS and distributed applications – Hides complexity and heterogeneity of distributed system – Bridges gap between low-level OS communications and programming language abstractions – Provides common programming abstraction and infrastructure for distributed applications – Overview at: http://www.middleware.org Distributed Applications Middleware Operating System Comms (packets, bits…) (remote calls, object invocation, messages, …) (sockets, IP, TCP, UDP, …) Network Middleware
  • 2. 2 Introduction to Middleware II • Middleware provides support for (some of): – Naming, Location, Service discovery, Replication – Protocol handling, Communication faults, QoS – Synchronisation, Concurrency, Transactions, Storage – Access control, Authentication • Middleware dimensions: – Request/Reply vs. Asynchronous Messaging – Language-specific vs. Language-independent – Proprietary vs. Standards-based – Small-scale vs. Large-scale – Tightly-coupled vs. Loosely-coupled components Middleware
  • 3. 3 Outline • Part I: Remote Procedure Call (RPC) – Historic interest • Part II: Object-Oriented Middleware (OOM) – Java RMI – CORBA – Reflective Middleware • Part III: Message-Oriented Middleware (MOM) – Java Message Service – IBM MQSeries – Web Services • Part IV: Event-Based Middleware – Cambridge Event Architecture – Hermes research research Middleware
  • 4. 4 Part I: Remote Procedure Call (RPC) • Masks remote function calls as being local • Client/server model • Request/reply paradigm usually implemented with message passing in RPC service • Marshalling of function parameters and return value Caller RPC Service RPC Service Remote Functio n call(…) 1) Marshal args 2) Generate ID 3) Start timer 4) Unmarshal 5) Record ID 6) Marshal 7) Set timer 8) Unmarshal 9) Acknowledge fun(…) message Middleware
  • 5. 5 Properties of RPC Language-level pattern of function call • easy to understand for programmer Synchronous request/reply interaction • natural from a programming language point-of-view • matches replies to requests • built in synchronisation of requests and replies Distribution transparency (in the no-failure case) • hides the complexity of a distributed system Various reliability guarantees • deals with some distributed systems aspects of failure Middleware
  • 6. 6 Failure Modes of RPC • Invocation semantics supported by RPC in the light of: network and/or server congestion, client, network and/or server failure note DS independent failure modes • RPC systems differ, many examples, local was Mayflower Exactly once (RPC system retries a few times) • Hard error return – some failure most likely note that “exactly once” cannot be guaranteed Maybe or at most once (RPC system tries once) • Error return – programmer may retry Middleware
  • 7. 7 Disadvantages of RPC  Synchronous request/reply interaction • tight coupling between client and server • client may block for a long time if server loaded leads to multi-threaded programming at client • slow/failed clients may delay servers when replying multi-threading essential at servers  Distribution Transparency • Not possible to mask all problems  RPC paradigm is not object-oriented • invoke functions on servers as opposed to methods on objects fork(…) join(…) remote call Middleware
  • 8. 8 Part II: Object-Oriented Middleware (OOM) • Objects can be local or remote • Object references can be local or remote • Remote objects have visible remote interfaces • Masks remote objects as being local using proxy objects • Remote method invocation object A proxy object B OOM OOM skeleton object B object B local remote object request broker / object manager object request broker / object manager Middleware
  • 9. 9 Properties of OOM Support for object-oriented programming model – objects, methods, interfaces, encapsulation, … – exceptions (were also in some RPC systems e.g. Mayflower) Synchronous request/reply interaction – same as RPC Location Transparency – system (ORB) maps object references to locations Services comprising multiple servers are easier to build with OOM – RPC programming is in terms of server-interface (operation) – RPC system looks up server address in a location service Middleware
  • 10. 10 Java Remote Method Invocation (RMI) • Covered in 1B Advanced Java programming • Distributed objects in Java public interface PrintService extends Remote { int print(Vector printJob) throws RemoteException; } • RMI compiler creates proxies and skeletons • RMI registry used for interface lookup • Entire system written in Java (single-language system) Middleware
  • 11. 11 CORBA • Common Object Request Broker Architecture – Open standard by the OMG (Version 3.0) – Language- and platform independent • Object Request Broker (ORB) – General Inter-ORB Protocol (GIOP) for communication – Interoperable Object References (IOR) contain object location – CORBA Interface Definition Language (IDL) • Stubs (proxies) and skeletons created by IDL compiler – Dynamic remote method invocation • Interface Repository – Querying existing remote interfaces • Implementation Repository – Activating remote objects on demand Middleware
  • 12. 12 CORBA IDL • Definition of language-independent remote interfaces – Language mappings to C++, Java, Smalltalk, … – Translation by IDL compiler • Type system – basic types: long (32 bit), long long (64 bit), short, float, char, boolean, octet, any, … – constructed types: struct, union, sequence, array, enum – objects (common super type Object) • Parameter passing – in, out, inout – basic & constructed types passed by value – objects passed by reference typedef sequence<string> Files; interface PrintService : Server { void print(in Files printJob); }; Middleware
  • 13. 13 CORBA Services (selection) • Naming Service – Names  remote object references • Trading Service – Attributes (properties)  remote object references • Persistent Object Service – Implementation of persistent CORBA objects • Transaction Service – Making object invocation part of transactions • Event Service and Notification Service – In response to applications‘ need for asynchronous communication – built above synchronous communication with push or pull options – not an integrated programming model with general IDL messages Middleware
  • 14. 14 Disadvantages of OOM  Synchronous request/reply interaction only • So CORBA oneway semantics added and - • Asynchronous Method Invocation (AMI) • But implementations may not be loosely coupled  Distributed garbage collection • Releasing memory for unused remote objects  OOM rather static and heavy-weight • Bad for ubiquitous systems and embedded devices Middleware
  • 15. 15 OOM experience Keynote address at Middleware 2009 Steve Vinoski From Middleware Implementor to Middleware User (There and back again) Available from the course materials page and the MW09 program on the website Middleware
  • 16. 16 Reflective Middleware • Flexible middleware (OOM) for mobile and context-aware applications – adaptation to context through monitoring and substitution of components • Interfaces for reflection – Objects can inspect middleware behaviour • Interfaces for customisability – Dynamic reconfiguration depending on environment – Different protocols, QoS, ... – e.g. use different marshalling strategy over unreliable wireless link Middleware
  • 17. 17 Part III: Message-Oriented Middleware (MOM) • Communication using messages • Messages stored in message queues • message servers decouple client and server • Various assumptions about message content Client App. local message queues Server App. local message queues message queues Network Network Network Message Servers Middleware
  • 18. 18 Properties of MOM Asynchronous interaction – Client and server are only loosely coupled – Messages are queued – Good for application integration Support for reliable delivery service – Keep queues in persistent storage Processing of messages by intermediate message server(s) – May do filtering, transforming, logging, … – Networks of message servers Natural for database integration Middleware
  • 19. 19 IBM MQSeries • One-to-one reliable message passing using queues – Persistent and non-persistent messages – Message priorities, message notification • Queue Managers – Responsible for queues – Transfer messages from input to output queues – Keep routing tables • Message Channels – Reliable connections between queue managers • Messaging API: MQopen Open a queue MQclose Close a queue MQput Put message into opened queue MQget Get message from local queue Middleware
  • 20. 20 Java Message Service (JMS) • API specification to access MOM implementations • Two modes of operation *specified*: – Point-to-point • one-to-one communication using queues – Publish/Subscribe • cf. Event-Based Middleware • JMS Server implements JMS API • JMS Clients connect to JMS servers • Java objects can be serialised to JMS messages • A JMS interface has been provided for MQ • pub/sub (one-to-many) - just a specification? Middleware
  • 21. 21 Disadvantages of MOM  Poor programming abstraction (but has evolved) • Rather low-level (cf. Packets) • Request/reply more difficult to achieve, but can be done  Message formats originally unknown to middleware • No type checking (JMS addresses this – implementation?)  Queue abstraction only gives one-to-one communication • Limits scalability (JMS pub/sub – implementation?) Middleware
  • 22. 22 Web Services • Use well-known web standards for distributed computing Communication • Message content expressed in XML • Simple Object Access Protocol (SOAP) – Lightweight protocol for sync/async communication Service Description • Web Services Description Language (WSDL) – Interface description for web services Service Discovery • Universal Description Discovery and Integration (UDDI) – Directory with web service description in WSDL Middleware
  • 23. 23 Properties of Web Services Language-independent and open standard SOAP offers OOM and MOM-style communication: • Synchronous request/reply like OOM • Asynchronous messaging like MOM • Supports internet transports (http, smtp, ...) • Uses XML Schema for marshalling types to/from programming language types WSDL says how to use a web service UDDI helps to find the right web service • Exports SOAP API for access http://api.google.com/GoogleSearch.wsdl Middleware
  • 24. 24 Disadvantages of Web Services  Low-level abstraction • leaves a lot to be implemented  Interaction patterns have to be built • one-to-one and request-reply provided • one-to-many? • still synchronous service invocation, rather than notification • No nested/grouped invocations, transactions, ...  No location transparency Middleware
  • 25. 25 What we lack, so far  General interaction patterns • we have one-to-one and request-reply • one-to-many? many to many? • notification? • dynamic joining and leaving?  Location transparency • anonymity of communicating entities  Support for pervasive computing • data values from sensors • lightweight software Middleware
  • 26. 26 Part IV: Event-Based Middleware a.k.a. Publish/Subscribe • Publishers (advertise and) publish events (messages) • Subscribers express interest in events with subscriptions • Event Service notifies interested subscribers of published events • Events can have arbitrary content (typed) or name/value pairs Event Service (event-broker network) Subscribe r Subscribe r Subscribe r Publisher Publisher Publisher publish publish publish subscribe subscribe subscribe notify notify notify Middleware
  • 27. 27 Topic-Based and Content-Based Pub/Sub • Event Service matches events against subscriptions • What do subscriptions look like? Topic-Based Publish/Subscribe – Publishers publish events belonging to a topic or subject – Subscribers subscribe to a topic subscribe(PrintJobFinishedTopic, …) (Topic and) Content-Based Publish/Subscribe – Publishers publish events belonging to topics and – Subscribers provide a filter based on content of events subscribe(type=printjobfinished, printer=‘aspen’, …) Middleware
  • 28. 28 Properties of Publish/Subscribe Asynchronous communication • Publishers and subscribers are loosely coupled Many-to-many interaction between pubs. and subs. • Scalable scheme for large-scale systems • Publishers do not need to know subscribers, and vice-versa • Dynamic join and leave of pubs, subs, (brokers - see lecture DS-8) (Topic and) Content-based pub/sub very expressive • Filtered information delivered only to interested parties • Efficient content-based routing through a broker network Middleware
  • 29. 29 Composite Event Detection (CED) • Content-based pub/sub may not be expressive enough – Potentially thousands of event types (primitive events) – Subscribers interest: event patterns (define high-level events, ref DS-2) • Event Patterns PrinterOutOfPaperEvent or PrinterOutOfTonerEvent • Composite Event Detectors (CED) – Subscribe to primitive events and publish composite events Publisher Publisher Publisher CED CED CED Publisher Subscribe r Subscribe r Middleware
  • 30. 30 Summary • Middleware is an important abstraction for building distributed systems • Synchronous vs. asynchronous communication • Scalability, many-to-many communication • Language integration • Ubiquitous systems, mobile systems 1. Remote Procedure Call 2. Object-Oriented Middleware 3. Message-Oriented Middleware 4. Event-Based Middleware Middleware