Middleware in a distributed system is the software layer that lies between the operating system and applications and enables the various components of a system to communicate and manage data. The purpose of middleware is to simplify the development of complex distributed systems by making it easier for applications to communicate with each other in a networked environment while enabling software developers to focus on the specific purpose of the application (the business logic). Middleware is often referred to as "plumbing" as it is used to connect applications and enable then to exchange data. It includes web servers, application servers, object request brokers, messaging systems, data distribution services and similar tools that can support distributed application development and deployment.
Middleware can perform a critical role in enabling interoperability between applications that may be written in different programming languages, running on different operating systems and underlying hardware by providing the ability to exchange data in a standards-based way. It also provides services and standard APIs that allow applications to:
- locate other applications transparently across a network
- filter data so that applications can exchange information in the most efficient manner and best use of network resources
- provide independence from programming language, operating system, network services and hardware
- provide a standard management API for applications
- be reliable and fault tolerant
- support the secure transfer of data between applications
By providing independence from programming language, operating system, hardware and network technologies, middleware can be used to support the development and integration of many different types of software systems from real-time embedded and mobile applications to large scale enterprise systems.
Organizations are increasingly using middleware to integrate existing legacy systems with new applications to create new services or more efficient processes with added business value for both organizations and their customers.
Middleware enables applications to communicate with each other not only across a local area network (LAN) but with the massive growth and importance of the World Wide Web across a wide area network (WAN) via the Internet.
Some of the most common categories of distributed middleware include:
- Message Oriented Middleware (MOM) – is a category of communication software that generally relies on asynchronous message-passing in contrast to a request-response style architecture. Typically in a message oriented middleware system an extra component called a message broker is used as the transfer agent between sender and receiver. The message broker provides important functions such as routing and message queuing (both transient and persistent). Message oriented middleware enables users to build "loosely coupled" systems that can evolve easily as sender and receiver applications do not necessarily have knowledge about each other at "compile time" or even be connected to the network at the same time when in operation. Examples of MOM technologies and standards include Object Management Group Data Distribution Service for Real-Time Systems (OMG DDS), Java Message Service (JMS), Advanced Message Queuing Protocol (AMQP), and Message Queuing Telemetry Transport (MQTT).
- In MOM "publish–and-subscribe" is probably the most important and widely used messaging pattern. Senders of messages, called publishers, do not program the messages to be sent directly to specific receivers, called subscribers. Instead, published messages are characterized into classes, without knowledge of what, if any, subscribers there may be. Similarly, subscribers express interest in one or more classes, and only receive messages that are of interest, without knowledge of what, if any, publishers there are.
- Remote Procedure Call (RPC) - is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space (commonly on another computer on network) without the programmer explicitly coding the details for this remote interaction. RPCs are used in systems that require a request-response style architecture. An RPC is initiated by the client, which sends a request message to a known remote server to execute a specified procedure with supplied parameters. The remote server sends a response to the client, and the application continues its process. Examples of RPC technologies include ONC RPC formerly SUN’s RPC and XML RPC.
- Object Request Brokers (ORBs) - in object oriented systems an ORB is a middleware which allows remote procedure calls to be made between objects running in different address spaces over a computer network. The whole process is transparent, resulting in remote objects appearing as if they were local. Again ORB middleware is used in systems that require request-response style interactions. Request-response based systems introduce a tighter coupling between client and server applications in comparison to Message Oriented Middleware and usually require "compile-time" knowledge of each other in order to communicate. Examples of ORB technologies include CORBA, .Net Remoting and Java RMI, although the term ORB has become synonymous with the Object Management Group's CORBA (Common Object Request Broker) standard.
- SQL-oriented middleware - provides transparent access to database objects (Tables, Indexes, Sequences, Views, Synonyms) regardless of their location via an SQL API. The database server can reside on the same node as the SQL client or on a different node on the network.