OK.
Hello bloggers and welcome to this lecture.
This lecture we're going to look at Eskew as soon as you might remember from the history section of
the course.
Eskew US was one of the very first AWOL services in fact it was the first AWOL service and for that
reason it's got a lot of legacy and it can definitely appear in your exam.
So what is escudos.
So why don't we start with the Amazon definition.
So Amazon excuse is a Web service that gives you access to a message queue that can be used to store
messages while waiting for a computer to process them.
So that's all it is as a way of storing messages while you're waiting for a computer to go and process
that message.
And escudos is a distributed queue system that enables web service applications to quickly and reliably
cue messages that one component in the application generates to be consumed by another component.
A queue is a temporary repository for messages that are waiting processing.
So essentially you've got a server.
It creates a message.
That message is stored in an excuse.
Q And it's waiting for another server to go in and process that message.
That's all escudos is.
And if that still doesn't make a lot of sense let's have a look at a couple of examples.
So let's say we've got a meme Web site we've got our user and they want to go ahead and create a meme
and let's say they upload a file to an S3 bucket that our Web site is using.
And this is a picture of the iCloud Gary team in Melbourne.
Let's say they want to create a meme out of that as soon as they upload that of that file to an S3 bucket
it triggers a lambda function and we're going to cover off what lambda is in the very next section of
the course.
But let's just say that it triggers the lambda function and that lambda function is just basically a
piece of programming that does something with this image.
What that lambda function does is it goes and stores information in escudos.
So it's going to store what caption that they want to right across this meme.
It's also going to store the location of this image in the S3 bucket and it's all stored in a message
in escudos.
We then have a fleet of E2 instances.
Now these can also be behind an auto scaling group or it could just be two or three or even just one
easy to instance.
And basically the easy two instances pole the escudos Q looking for messages and when they get a message
they basically take that message from the rescuers queue and then they go ahead and create the meme.
And let's say they store that mean into S3.
So it looks like something like this halo cloud gears.
That is then stored in S3.
Now if we were to lose our easy to instance or a fleet of AC two instances the messages are still held
in the rescuers.
Q And another easy to instance can come along and process them.
Another example of an escudos website would be a travel website.
So let's say we've got our user and they want to book a holiday.
Let's say it's with Expedia or with Sky Scanner big shout out to both those companies because I use
them all the time.
So our user is basically they put a query into our web servers and they say hey I want to go to Cancun
for these two weeks and they enter in the date and then basically what that easy to instance does is
it takes what the user is requesting and it stores it in an excuse.
Q We then have a fleet of EU web servers and they are pulling back.
Q And they're looking for that excuse message and then what they do is they go out and query all the
different airlines servers saying hey how much is a flight from Cancun on these dates.
So it might poll American Airways or they might poll Delta or they might poll Virgin Atlantic or wherever
and basically they then store that take that information and then they send that information back to
the web server who sends it back to the user.
So that's another good example of using Eskew as using Amazon Eskew as you can decouple the components
of your application so that they run independently easing message management between components and
any component of a distributed application can store messages in a fail safe.
Q And messages can contain up to 256 kilobytes of text in any format any component can later retrieve
the messages programmatically using the Amazon escudos API.
Now this 256 kilobytes of text is contained within the Eskew rescue itself.
If you need to go over that you can you can currently go up to I think it's 2 gigabytes in size.
And those messages are then stored on S3 but SARS is still able to access that but most people 256 256
kilobytes of text is enough and that's all stored on escudos.
So the Q acts as a buffer between the components producing and saving data and the components receiving
the data for processing.
And this means that the Q resolves issues that arise if the producer is producing work faster than the
consumer can process it or if their producer or consumer only intermittently connected to the network
so you can actually go in and set up auto scaling groups and you can have a trigger as to how many messages
are in the queue and if the number of messages goes over five or a hundred or a thousand that can trigger
an auto scaling event.
So there's two different types of cues with rescuers.
We have our standard cues which are accused by default and then we have our fifth cues her first in
first out cues so Eskew a standard is the default cue type and a standard cue and lets you have nearly
unlimited number of transactions per second and standard cues guarantee that a message is delivered
at least once.
However occasionally because of the highly distributed architecture that allows high throughput more
than one copy of a message might be delivered out of order standard cues provide best effort ordering
which ensures that the messages are generally delivered in the same order that they are sent.
So it's it's generally in the same order that they're sent but there's no promises.
And remember that messages can be delivered more than once.
So the fifth queue complements the standard queue and the most important features of this queue is that
they're first in first out so they are definitely ordered and you will all get exactly one time processing.
So the order in which the messages are sent and received is strictly preserved and a message is delivered
once and it remains available until the consumer processes and deletes it duplicates are not introduced
into the queue.
So if you need to have order in your queue and you don't want to have any duplicates you want FIFA if
that doesn't matter if your application can have duplicates and you're not too concerned about how often
messages are delivered and in what order then you can go ahead and just use standard.
And you're going to be quizzed on this in your exam.
Remember that FIFA cues also support message groups that allow multiple ordered message groups within
a single queue.
So FIFA queues are limited to 300 transactions per second but they have all the same capabilities of
a stand a queue.
So that's it for escudos.
You just need to understand what it is at a high level.
Just remember my exam tips excuse is always going to be Paul Bass it's not pushed bass you've got your
easy two instances they're going in there and they're pulling messages down from the queue excuses not
pushing the messages out to you.
Easy two instances if he needs anything that's pushed bass we're going to be using S.A. and we'll look
at that later on in this section of the course messages are 256 kilobytes in size when you're using
escudos you can go up to two gigs but you're going to be need to be using S3 for that message is always
256 kilobytes in size and messages can be kept in the queue from one minute to 14 days and the default
retention period is four days.
Also remember that the visibility time out and the visibility time out is the amount of time that messages
are invisible in the escudos queue after a reader picks up that message.
So let's say we've got our main website and we send that message off to our rescue rescue our easy to
instance will pick that message up and that will basically make that message invisible to other EU instances
but that message will time out unless that easy to instance goes in and deletes that message and when
it times out it becomes visible again.
And the thing about this is it stops your easy two instances from if they die.
You know that the message is still in the queue.
It will hit the visibility time out period.
It will become visible again and then another easy to instance will come in and read that message.
Now provided the job is process before the visibility time out expires the message will then be deleted
from the queue.
And if the job is doesn't process within that time frame the message will become visible again.
And another reader will process it.
And this could result in the same message being delivered twice and the visibility time out maximum
is 12 hours.
So easy to instance has 12 hours in which to process rescuers messages.
Also remember going into your exam that rescuers guarantees that your messages will be processed at
least once and rescuers long polling is a way to retrieve messages from your Amazon asking rescue.
So while the regular short polling returns messages immediately even if the message queue being polled
is empty long polling doesn't return a response until the message arrives in the message queue all the
long pole times out.
So essentially this is a way of saving money.
You don't have your easy two instances constantly polling an empty rescuers pull pull what you do is
you turn on long polling and then that will save you some money long polling won't return a response
until a message arrives in the message queue or the long pole times out.
So that is it for this lecture everyone if you have any questions please let me know.
We're not going to do anything hands on with ask us in this course.
You just basically need to know what excuse is and the different skew types.
So you've got a standard and then FIFA and then just understand its use case it's a way of decoupling
your tightly coupled infrastructure.
You do want to learn more about rescuers.
Definitely check out the obvious documentation.
So if you've got any questions please let me know.
If not feel free to move on to the next lecture.
Thank you.