Learning Library

← Back to Library

Middleware: The Hidden Engine Behind E‑commerce

Key Points

  • Middleware is the hidden layer of software and hardware services that coordinate tasks—from browsing a catalog to payment processing and shipping—to deliver a seamless user experience.
  • In an online purchase, middleware integrates the mobile app, store front, image repository, inventory service, payment gateway, warehouse system, and logistics provider, each acting as modular components that can be reused elsewhere.
  • The primary purpose of middleware is to give developers ready‑made capabilities (e.g., data storage, authentication, concurrency control) so they don’t have to rebuild complex functionality from scratch for every new application.
  • Databases exemplify middleware by handling massive concurrent access, permission enforcement, scaling, and data integrity behind simple CRUD or REST API calls, freeing developers from low‑level performance concerns.
  • APIs (especially RESTful ones) serve as the standardized interfaces through which middleware services expose their functionality, enabling different applications to interact reliably and efficiently.

Full Transcript

# Middleware: The Hidden Engine Behind E‑commerce **Source:** [https://www.youtube.com/watch?v=1oWPUpMheGk](https://www.youtube.com/watch?v=1oWPUpMheGk) **Duration:** 00:10:09 ## Summary - Middleware is the hidden layer of software and hardware services that coordinate tasks—from browsing a catalog to payment processing and shipping—to deliver a seamless user experience. - In an online purchase, middleware integrates the mobile app, store front, image repository, inventory service, payment gateway, warehouse system, and logistics provider, each acting as modular components that can be reused elsewhere. - The primary purpose of middleware is to give developers ready‑made capabilities (e.g., data storage, authentication, concurrency control) so they don’t have to rebuild complex functionality from scratch for every new application. - Databases exemplify middleware by handling massive concurrent access, permission enforcement, scaling, and data integrity behind simple CRUD or REST API calls, freeing developers from low‑level performance concerns. - APIs (especially RESTful ones) serve as the standardized interfaces through which middleware services expose their functionality, enabling different applications to interact reliably and efficiently. ## Sections - [00:00:00](https://www.youtube.com/watch?v=1oWPUpMheGk&t=0s) **Middleware Explained Through E‑Commerce** - The speaker uses the simple act of buying a water bottle online to illustrate how middleware links databases, image repositories, delivery checks, payment processors, and warehouse systems, creating the seamless experience users expect. - [00:03:06](https://www.youtube.com/watch?v=1oWPUpMheGk&t=186s) **REST API Basics Overview** - The speaker explains how REST APIs use simple HTTP verbs (GET, POST, PUT, DELETE) as unified interfaces to retrieve, create, update, and delete data in databases, abstracting away underlying communication complexities. - [00:06:13](https://www.youtube.com/watch?v=1oWPUpMheGk&t=373s) **Message Queues as Everyday Logistics** - The speaker illustrates how a message queue decouples producers and consumers—much like a water bottle moving on a conveyor belt—by letting applications enqueue data for asynchronous processing without tight coupling. - [00:09:28](https://www.youtube.com/watch?v=1oWPUpMheGk&t=568s) **Cloud Automation Simplifies Microservices** - The speaker explains how cloud automation tackles the complex, repetitive tasks of managing microservices, allowing teams to focus on innovation while also encouraging viewers to engage with the channel. ## Full Transcript
0:00What is middleware? 0:02The other day I bought this water bottle online. 0:06Didn't think particularly much about it. 0:07I hit "buy now" and then went on with my day. 0:09And to be honest, when it got delivered, I saw the box on my doorstep and I had to open the box before remembering 0:15"Oh, that's right, I ordered a water bottle.". 0:17Suffice to say, at least from my end, getting this water bottle was no big deal. 0:23But that's only because behind the scenes there are countless software and hardware components 0:29working in harmony to deliver a seamless, unified experience we've come to expect. 0:35Let me explain. 0:36So I used an app on my phone and that connects to the store. 0:44And then from there, I can browse that store, 0:46which is interfacing with a database to get some information about available items. 0:54There's an image repository that I can pull items in from-- so I can see the colors and the sizes of the water bottle. 1:01Maybe there's another service over here which allows me to see which of those items might be available for next-day delivery. 1:09The middleware that brought me my water bottle, though, isn't only about databases. 1:14Any time you have a service that could be useful in multiple situations, that's a possibility to use middleware. 1:21And then when I hit the purchase button, it reaches out to my credit card company-- that's another box. 1:28Assuming that checks out, the information about my water bottle 1:31and where it should go gets sent to a warehouse, and then ultimately it gets sent out for shipping on a truck. 1:42A lot of stuff going on there for my water bottle. 1:44And these components, and then in some cases, components within these components, are like-- 1:50this one might consist of other subcomponents. 1:54They can all be thought of as middleware. 1:56And the whole point of middleware is to provide capabilities to developers so they don't have to build everything 2:03from scratch every time they start working on a new solution. 2:07And you might be thinking here: "Eh, a database? 2:10Well, that's just reading and writing data. That's no big deal." 2:13But what about dealing with situations where there's multiple applications going for the same piece of data at the same time? 2:21What about managing permissions? 2:23So we can be sure that data is only being seen by people with read access and only updated with people who have write access. 2:31Now, what about doing that several billion times a day, all day long, in a situation where any errors could be disastrous? 2:40And where in the blink of an eye, which is 100 milliseconds, is considered too slow. 2:4910. 2:50Yeah, that's better. 2:52Yeah. 2:52So I wouldn't want to be stuck with that responsibility either. 2:57Which is why databases exist as middleware. 3:01We can let the database handle the complexity of scaling and performance and data integrity. 3:07And we drive all of that through a relatively simple, or at least simpler, set of interfaces. 3:13Put this data somewhere. 3:14Get this data for me. 3:16Delete this piece of data. 3:19These are just a few examples of REST APIs. 3:27And APIs are application programing interfaces. 3:30And that simpler way of interfacing with middleware in a simplified manner. 3:34So with all the databases, all we have to do is say "Get this data for me". 3:40And this other data we can say "Put it there", and so forth. And we can let the data worry about-- 3:46--the database worry about all that sort of complicated stuff of the communication behind it. 3:51Now, this specific type of API, REST, stands for REpresentational State Transfer. And it uses verbs. 4:00So we have verbs like PUT and GET. 4:06And we have verbs like POST, and DELETE. 4:15And these are usually followed by some sort of record indicator. 4:19So, for GET, we might say GET and then we would specify a record and we would provide the ID. 4:29Say 12345. 4:32And in the case of PUTs and POSTs, which are typically used to create and update records, 4:38these are also usually containing the actual data of the record as well. 4:45So with our POST, we might actually specify a record, and then in curly brackets here, 4:51we're going to specify what's to go in that record-- what we want recorded. 4:57Now, REST APIs are becoming increasingly common since they can be called from just about any programing language-- 5:04to and from any hybrid cloud platform-- to and from just about any computing device. 5:10That interface is just one more part of the puzzle that's already been figured out. 5:16And we don't have to code from scratch. 5:19Now, middleware isn't all databases, though. 5:22Any time there's a service that might be helpful in multiple situations, that can be middleware. 5:28One of the more difficult aspects of working in hybrid cloud environments is making sure applications 5:34communicate effectively. Let's say we've got these five applications here-- these five circles. 5:43And then we have five other applications down here-- we'll split those out. 5:50Now these go out and they gather data, and then these ones down here, they process that data. 5:56So it seems pretty simple, but here's the catch: 5:58These guys sometimes take a little while to finish processing, these guys on the top here. 6:03So they might be busy when these guys down at the bottom have new data that needs processing. 6:08Also, it's very important that each piece of data can only be processed once. 6:13Think paychecks, weather bulletins, order for a water bottle-- 6:18though I certainly wouldn't mind getting a second water bottle, or a second paycheck, for that matter. 6:24Anyway, we could code a whole bunch of logic into these applications describing a method for finding an available--. 6:32one of these applications --and handing off the data and then ensuring the data was transferred successfully and all of that fun stuff. 6:40Or we could use a message queue-- data that gets placed on the queue by publishers or producers. 6:47So we place data onto a queue and then it gets picked up by the other end by the consumers. 6:57That's these guys at the bottom here and they can receive it when they're available. 7:02With a queue in place, we don't have to close the communication between these two applications. 7:07And it doesn't matter how many of these we have or how many of these that we actually have to code. 7:13It all stays exactly the same. 7:15The data goes on to the queue up here and then the data gets pulled off the queue down at the bottom. 7:21And if all the processing of the applications are busy, the data can wait its turn in the queue. 7:26That is a great use of MQ as middleware right there. 7:30Now coming back to my old friend, this water bottle: 7:34I can almost guarantee that at some point, it was taking a ride on a long conveyor belt and a robotic arm 7:40or some sort of mechanism leapt into action and put it into a box, 7:45or a bin, or some other conveyor belt, where it could continue its journey to my front door. 7:50And that network of conveyor belts and sensors and arms and cameras, well, the movements 7:57and the calculations needed to watch for a particular item, catch it, maybe sort it, and apply a label to it. 8:03That all sounds pretty complex, 8:05and it's also sounds like something that could be used for, well, reuse, simplicity and scalability's sake. 8:12So it's a good thing we have something called Robotic Middleware. 8:21And that drives all of this-- all of that automation --because an application crashing is bad enough, but imagine having a two-ton 8:29robotic arm crash into another two-ton robotic arm because someone tried to write their own robot control code. 8:36That would probably put my water bottle a day or two behind schedule. 8:41You can see middleware, it comes in all shapes and sizes. 8:44We talked about database processing millions or billions of records a day. 8:50We talked about robotic arms grabbing boxes off high-speed conveyor belts. 8:53But we might also consider one more thing, which is microservices. 9:03Now microservices are a form of middleware. 9:05And when we check and see the status of our delivery, 9:09or we get curious to see what else might be accessorizing well with my beautiful water bottle. 9:15That's perhaps not a crucial part of the big picture, but those are nice reusable pieces of logic 9:21which can be served up as microservices, which fit right alongside many of the other pieces of middleware we depend on every day. 9:29And if you are thinking, "Great, so now we have a whole bunch of code to worry about related to microservices and keep track of". 9:36Well, that's one more reason that cloud automation plays a vital role in modernizing applications, because in case you haven't 9:43noticed, the goal in all of this is to let the machines handle the complex, 9:48monotonous work so we can focus on what makes us unique. 9:53Now, if you'll excuse me, all of this talking is maybe quite thirsty. 10:00If you have any questions, please drop us a line below. 10:02And if you want to see more videos like this in the future, please Like and Subscribe. 10:08Thanks for watching.