What is middleware?
The other day I bought this water bottle online.
Didn't think particularly much about it.
I hit "buy now" and then went on with my day.
And to be honest, when it got delivered, I saw the box on my doorstep and I had to open the box before remembering
"Oh, that's right, I ordered a water bottle.".
Suffice to say, at least from my end, getting this water bottle was no big deal.
But that's only because behind the scenes there are countless software and hardware components
working in harmony to deliver a seamless, unified experience we've come to expect.
Let me explain.
So I used an app on my phone and that connects to the store.
And then from there, I can browse that store,
which is interfacing with a database to get some information about available items.
There's an image repository that I can pull items in from-- so I can see the colors and the sizes of the water bottle.
Maybe there's another service over here which allows me to see which of those items might be available for next-day delivery.
The middleware that brought me my water bottle, though, isn't only about databases.
Any time you have a service that could be useful in multiple situations, that's a possibility to use middleware.
And then when I hit the purchase button, it reaches out to my credit card company-- that's another box.
Assuming that checks out, the information about my water bottle
and where it should go gets sent to a warehouse, and then ultimately it gets sent out for shipping on a truck.
A lot of stuff going on there for my water bottle.
And these components, and then in some cases, components within these components, are like--
this one might consist of other subcomponents.
They can all be thought of as middleware.
And the whole point of middleware is to provide capabilities to developers so they don't have to build everything
from scratch every time they start working on a new solution.
And you might be thinking here: "Eh, a database?
Well, that's just reading and writing data. That's no big deal."
But what about dealing with situations where there's multiple applications going for the same piece of data at the same time?
What about managing permissions?
So we can be sure that data is only being seen by people with read access and only updated with people who have write access.
Now, what about doing that several billion times a day, all day long, in a situation where any errors could be disastrous?
And where in the blink of an eye, which is 100 milliseconds, is considered too slow.
10.
Yeah, that's better.
Yeah.
So I wouldn't want to be stuck with that responsibility either.
Which is why databases exist as middleware.
We can let the database handle the complexity of scaling and performance and data integrity.
And we drive all of that through a relatively simple, or at least simpler, set of interfaces.
Put this data somewhere.
Get this data for me.
Delete this piece of data.
These are just a few examples of REST APIs.
And APIs are application programing interfaces.
And that simpler way of interfacing with middleware in a simplified manner.
So with all the databases, all we have to do is say "Get this data for me".
And this other data we can say "Put it there", and so forth. And we can let the data worry about--
--the database worry about all that sort of complicated stuff of the communication behind it.
Now, this specific type of API, REST, stands for REpresentational State Transfer. And it uses verbs.
So we have verbs like PUT and GET.
And we have verbs like POST, and DELETE.
And these are usually followed by some sort of record indicator.
So, for GET, we might say GET and then we would specify a record and we would provide the ID.
Say 12345.
And in the case of PUTs and POSTs, which are typically used to create and update records,
these are also usually containing the actual data of the record as well.
So with our POST, we might actually specify a record, and then in curly brackets here,
we're going to specify what's to go in that record-- what we want recorded.
Now, REST APIs are becoming increasingly common since they can be called from just about any programing language--
to and from any hybrid cloud platform-- to and from just about any computing device.
That interface is just one more part of the puzzle that's already been figured out.
And we don't have to code from scratch.
Now, middleware isn't all databases, though.
Any time there's a service that might be helpful in multiple situations, that can be middleware.
One of the more difficult aspects of working in hybrid cloud environments is making sure applications
communicate effectively. Let's say we've got these five applications here-- these five circles.
And then we have five other applications down here-- we'll split those out.
Now these go out and they gather data, and then these ones down here, they process that data.
So it seems pretty simple, but here's the catch:
These guys sometimes take a little while to finish processing, these guys on the top here.
So they might be busy when these guys down at the bottom have new data that needs processing.
Also, it's very important that each piece of data can only be processed once.
Think paychecks, weather bulletins, order for a water bottle--
though I certainly wouldn't mind getting a second water bottle, or a second paycheck, for that matter.
Anyway, we could code a whole bunch of logic into these applications describing a method for finding an available--.
one of these applications --and handing off the data and then ensuring the data was transferred successfully and all of that fun stuff.
Or we could use a message queue-- data that gets placed on the queue by publishers or producers.
So we place data onto a queue and then it gets picked up by the other end by the consumers.
That's these guys at the bottom here and they can receive it when they're available.
With a queue in place, we don't have to close the communication between these two applications.
And it doesn't matter how many of these we have or how many of these that we actually have to code.
It all stays exactly the same.
The data goes on to the queue up here and then the data gets pulled off the queue down at the bottom.
And if all the processing of the applications are busy, the data can wait its turn in the queue.
That is a great use of MQ as middleware right there.
Now coming back to my old friend, this water bottle:
I can almost guarantee that at some point, it was taking a ride on a long conveyor belt and a robotic arm
or some sort of mechanism leapt into action and put it into a box,
or a bin, or some other conveyor belt, where it could continue its journey to my front door.
And that network of conveyor belts and sensors and arms and cameras, well, the movements
and the calculations needed to watch for a particular item, catch it, maybe sort it, and apply a label to it.
That all sounds pretty complex,
and it's also sounds like something that could be used for, well, reuse, simplicity and scalability's sake.
So it's a good thing we have something called Robotic Middleware.
And that drives all of this-- all of that automation --because an application crashing is bad enough, but imagine having a two-ton
robotic arm crash into another two-ton robotic arm because someone tried to write their own robot control code.
That would probably put my water bottle a day or two behind schedule.
You can see middleware, it comes in all shapes and sizes.
We talked about database processing millions or billions of records a day.
We talked about robotic arms grabbing boxes off high-speed conveyor belts.
But we might also consider one more thing, which is microservices.
Now microservices are a form of middleware.
And when we check and see the status of our delivery,
or we get curious to see what else might be accessorizing well with my beautiful water bottle.
That's perhaps not a crucial part of the big picture, but those are nice reusable pieces of logic
which can be served up as microservices, which fit right alongside many of the other pieces of middleware we depend on every day.
And if you are thinking, "Great, so now we have a whole bunch of code to worry about related to microservices and keep track of".
Well, that's one more reason that cloud automation plays a vital role in modernizing applications, because in case you haven't
noticed, the goal in all of this is to let the machines handle the complex,
monotonous work so we can focus on what makes us unique.
Now, if you'll excuse me, all of this talking is maybe quite thirsty.
If you have any questions, please drop us a line below.
And if you want to see more videos like this in the future, please Like and Subscribe.
Thanks for watching.