5 - Middleware Flashcards
Middleware
Middleware is a type of software used to manage and facilitate interactions between applications across computing platforms
What is Middleware used for?
Middleware enables the distribution of applications to multiple computers in the network
Middleware technologies (3)
- Common Object Request Broker Architecture (CORBA)
- Distributed Component Object Model (DCOM)
- Remote Method Invocation (RMI)
- Also: Web Services (extension of middleware concept)
Abstractions of middleware
- Remote Procedure Call
- Distributed Objects
- Message Queues
- Web Services
Remote Procedure Calls (RPC)
A remote procedure call is the synchronous language level transfer of control between programs in disjoint address spaces whose primary communication medium is a narrow channel.
Ein Remote-Prozeduraufruf ist die synchrone Übertragung der Steuerung auf Sprachebene zwischen Programmen in disjunkten Adressräumen, deren primäres Kommunikationsmedium ein schmaler Kanal ist.
What are RPC used for?
- RPC allows functions to be called from other address spaces (frequently on another computer on a shared network)
- Usually, the called functions and the calling program are not executed on the same computer
- The general idea of a procedure call fits the request response pattern
-> The client makes a request to some external application, sleeps, and finds the result after
control is returned to the procedure
Client Stub
- Can be called via regular procedure call
2. Marshals (verpacken) arguments and sends request message to server
Server stub
- Receives request message and unmarshals (entpacken)
arguments - Calls server procedure
- Marshals results and sends response message to client
Marshalling: How is problem of serialization of Arguments and return values of procedures solved?
- RPC defines application layer protocol above transport layer
- Format and sequence of messages (requests,
response, binding, etc.) - Mapping to transport protocol(s)
- Format and sequence of messages (requests,
- Additionally, specifies encoding of language types (XDR, XML, ..) to message payload
-> Standard protocols and encodings are key for interoperability between different middleware systems
Binding: How is problem of specifying what server the client want to bind to solved?
Static Binding: Client statically bound to address of
server
+ Simple, No Overhead
- No load balancing, No failover (Ausfallversicherung)
Dynamic Binding: Client dynamically locates server before (first) call
+ enables load balancing, redundant servers provide failover
- Requires additional service, Overhead of lookup
Portmapping and dispatching: How is problem of dispatching requests to correct process and procedure solved?
Portmapping in RPC:
- Client specifies address, program, and version number of server
- Portmapper returns port of server process
- Server stub dispatches request message to correct method implementation
What are the three types of Middleware?
- Message-Oriented Middleware
- Transaction-Oriented Middleware
- Object-Oriented Middleware
Message oriented middleware (MOM)
Message oriented middleware (MOM) is any middleware infrastructure that provides messaging capabilities . It provides a means to build distributed systems, where distributed processes communicate through messages exchanged via message queuing or message passing
How are messages exchanged?
- Messages are exchanged peer to peer (mostly in XML format)
- Asynchronous Message Passing
or - Message queue as an intermediary (Message Queuing)
Massage passing (Asynchronous)
- Client does not wait for response
- refers to transient communication between two processes that are active at the same time
Message Queuing
- Message queue accepts messages to different programs; addressed programs are activated as needed, answers can be fetched later from the queue
- Queue manager can optimize the performance (e.g., prioritization, load allocation)
- Queue manager utilizes persistence and transaction support to protect against loss
-The message queuing model requires an additional intermediary component, which is called the message queue (essentially a mailbox independent of the receiver)
Message Broker
- Sender does not need to be aware on which system the server is running
- Receiver can change location during the runtime location dependency is reduced
- Option to change to multicast or broadcast system (not deleting message after first deque operation) -> option for multiple receivers
What are two MOM software examples
Microsoft Message Queue
- Used for simple integration of Windows applications
WebSphere MQ
- Available on almost all platforms
- Better scalable because available on more powerful platforms
- Higher fault tolerance, greater reliability of delivery of messages, higher security, better database access
- Broadcasting, publish/subscribe service
- Mature, tested
- Disadvantage: Installation consuming
Transaction Oriented Middleware (TOM)
Transaction Oriented Middleware (TOM) is any middleware infrastructure that supports the execution of electronic transactions in a distributed setting
Two-Phase commit
Prepare Phase: A coordinator (usually the process that initiates the committing) obtains approval or denial to commit the data changes of all the processes involved
Commit Phase:
(When all participants agree) the coordinator decide to ‚Commit’. If the decision has been made, the coordinator informs the participants of the result in the second phase
What does ACID (transactions) stand for?
atomicity, consistency, isolation, and durability
Automicity
Each transaction is either fully executed or not at all (rollback if something fails)
Consistency
Transaction leaves database in a consistent state given it was consistent before the transaction
Isolation
Transactions cannot influence other transactions when
executed parallel
Durability
Permanent storage in DB is guaranteed once a transaction is completed successfully
Transaction Processing Monitor
coordinate the flow of requests between terminals or other devices and application programs that can process these requests
- not developed for general program-to-program communication integration but provide solutions for transaction-type applications that utilize a database
TP-Lite Monitor
- integrated in database (for small applications)
- Stored procedure invoked and executed
according to ACID principles - Better for periodic data synchronisation
TP-Heavy Monitor
- Supports client server architecture
- Allows for very complex transactions
- Good when using multiple databases
Transaction
a series of database operations that are executed either in full or not at all
Object Oriented Middleware (OOM)
Object Oriented Middleware (OOM) is defined as a middleware infrastructure that offers object oriented principles for the development of distributed systems
- Enables communication between objects within distributed systems
Interface Description Language (IDL)
language syntax to describe a software component’s interfaces
Common Object Request Broker Architecture (CORBA)
client can discover a service at runtime (Dynamic
Skeleton Interface)
Components of TP Monitor
- Transaction Management
- interface (API, presentation, authentication)
- program flow
- Registered programs
- TP Services
- Resources
- router
- communication manager