Middleware: The Glue Between Software Layers, Explained

UPI Study › Courses › Software Engineering › Free lessons › Lesson 15.1 Free with a free account

Middleware: The Glue Between Software Layers

Software Engineering · Chapter 15: Distributed Systems, Services, and Sociotechnical TopicsSection 15.1 · lesson 95 of 1035 min · free with a free account

← How Distributed Computing Works: Principles and EnvironmentsNext lesson: Client-Server Networks: How They Work and When to Use Them →

Earn 3 college credits for Software EngineeringRecommended for credit by NCCRS · Computer Science 301 · self-paced · one payment, lifetime access

In this lesson

Handling the mechanics of getting separate pieces to talk.

  • Explain what middleware does, and where it sits
  • Explain the complexity problem it solves as components multiply
  • Describe 3 common types of middleware
  • Choose between asynchronous and synchronous communication

Transcript

Everything said in the video, section by section (708 words). Read along, or search it.

Distributed Systems, Services, and Sociotechnical Topics

Middleware: The Glue Between Software Layers

A distributed system is made of separate pieces, running on separate machines. Something still has to handle the actual mechanics of getting them to talk to each other. That something is middleware.

What Middleware Does

Between the Components

In a distributed system, separate components run as separate programs, often on separate machines entirely. They share no memory, and they may even be written in different languages. For them to work together, something has to carry a message, a request, or a piece of data from one to another, across a network. Middleware is the software layer that does exactly that. It sits between the components, and takes care of the mechanics of communication. So each component's own code can focus on what it is actually meant to do, rather than reimplementing networking and data translation.

The Problem It Solves

Connections Multiply

Without a shared layer, every component that needs to talk to another needs its own custom connection to it. And as the number of components grows, the number of direct connections grows much faster. Five components, wired directly to each other, already need ten separate connections, each with its own quirks to maintain. Adding a sixth component would mean five new direct connections. Through middleware, adding that sixth component means exactly one.

Figure 1

From a Tangle to a Hub

Here is the difference. On the left, five components are wired directly to each other. That is ten connections, and the tangle grows with every new component. On the right, the same five components each connect only to the middleware. Each one has just one connection to maintain, and the middleware gets each message to wherever it needs to go.

Think About It

Is There Less Communication?

Think about this. In the middleware picture, every component is still, ultimately, communicating with every other one. So has the amount of communication actually gotten any smaller? No. The total communication is the same. What has gotten smaller is the number of connections each component has to know how to maintain. The complexity of managing it has shrunk.

Table 1

3 Common Types of Middleware

Middleware is not one single technique. Several approaches solve the same problem in different ways. With message-oriented middleware, components exchange messages through a shared queue. The sender does not wait for the receiver to be ready. With a remote procedure call, a component calls a function on a remote component much like calling a local one, and waits for the result. And with an object broker, a broker locates the right remote object, and routes the call to it on the caller's behalf.

What Matters in Practice

Timing - and Location

The difference that matters most in practice is timing. Message-oriented middleware is asynchronous. Component A sends its message and moves on, without needing B to be running or ready at that moment. A remote procedure call is synchronous. A calls, and then waits, just as it would for a local function. That is simple to reason about, but it means A is stuck until B responds. An object broker adds one more job. It figures out where the right remote object actually is, so the caller never has to track that location.

Apply It

B Might Be Offline

Let's apply that. Component A needs to notify component B of an event. But B might be temporarily offline when the event happens, and A should not have to wait for it. Which middleware fits? Message-oriented middleware. It is asynchronous, so A can put its message in the queue and continue. And B can retrieve the message once it comes back online.

Key Terms

The Vocabulary of This Section

Let's lock in the key terms. Middleware is the software layer between distributed components that handles the mechanics of communication between them. Message-oriented middleware passes messages through a shared queue, without the sender waiting for the receiver to be ready. A remote procedure call lets a component call a function on a remote component like a local one, waiting for the result. And an object broker locates the correct remote object, and routes a call to it on the caller's behalf.

Key Takeaways

What to Carry Forward

To pull this together. Middleware handles the mechanics of communication between distributed components, so their own code does not have to. Without it, direct connections grow much faster than the number of components. Middleware collapses that tangle, by giving each component one connection to maintain. Message-oriented middleware is asynchronous, and remote procedure calls are synchronous. And an object broker also locates the right remote object, before routing a call to it.

About Software Engineering at UPI Study

Software Engineering (Computer Science 301) is a self-paced online course of 103 video lessons in 15 chapters, from process models and agile to requirements, design, user interfaces, reliability, security and project management. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Software Engineering vs Systems Analysis

Why take it here

Why students take Software Engineering with UPI Study

How professional software gets builtSoftware Engineering covers how teams turn requirements into working, maintainable software: process models, agile, requirements, design, testing, reliability and project management. It is a core course in computer science and software degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Software Engineering carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Middleware: The Glue Between Software Layers

What is middleware in a distributed system?
Middleware is the software layer between distributed components that handles the mechanics of communication between them, carrying messages, requests, and data across a network. Because the components share no memory and may be written in different languages, middleware lets each component's own code focus on its job instead of reimplementing networking and data translation.
Why does middleware reduce complexity as a system grows?
Middleware gives each component one connection to maintain instead of a custom link to every other component. Five components wired directly need ten connections, and adding a sixth needs five more; through middleware, the sixth needs just one. The total amount of communication stays the same, but the complexity of managing connections shrinks.
What is the difference between message-oriented middleware and remote procedure calls?
Message-oriented middleware is asynchronous, while a remote procedure call (RPC) is synchronous. With message-oriented middleware, a sender places a message in a shared queue and moves on without waiting for the receiver to be ready. With an RPC, a component calls a function on a remote component much like a local one and waits for the result, which is simple to reason about but blocks the caller.
What does an object broker do in middleware?
An object broker locates the correct remote object and routes a call to it on the caller's behalf, so the caller never has to track where that object actually lives. That location step is the main thing it adds beyond basic communication. It is one of several common middleware approaches, alongside message-oriented middleware and remote procedure calls.

About the Software Engineering course

How many college credits is Software Engineering?
Software Engineering (Computer Science 301) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Software Engineering cost and what is included?
$250, paid once, with lifetime access: all 103 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Software Engineering take?
It is self-paced with no deadlines. The 103 lessons total about 11 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Software Engineering.

103 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Software Engineering
3 credits · NCCRS
Enroll →