Hi, everyone, and welcome back.
Now, in today's video, we are going to discuss about the SAS fan out.
Now, before we discuss about this specific topic, it is important for us to understand what exactly
this fan out pattern means.
So at a high level overview, fan out is a pattern in which a message is delivered to multiple set of
destination.
So this can be seen in the diagram where you have a producer and this producer is sending same message
to three destination, which are consumer one, consumer two and consumer three.
So this is what a fan out pattern does.
So let's go ahead and quickly look into a use case where this kind of a pattern can be useful and the
use case is related to ordering a product.
For example, let's say customer has placed an order on the website.
Now this order and its associated details are being sent to two set of consumers.
One is the logistic queue.
So this will be connected to the application that deals with logistic.
And second is the notification queue.
And you can also connect multiple other queues related to any other use cases.
Now it is important for us to know the basics of the SAS fan out pattern.
So in essence fan out pattern.
What really happens is that there is a publisher which publishes a message to the SAS topic, and this
SAS topic sends the message to multiple set of endpoints.
In this diagram, the endpoints are excuse Q and from the sky.
Q You have a set of easy two instances and these EC two instances can fetch the message and they can
process depending upon the requirements.
Now note that although in this diagram you have us.
Q But when we discuss about SAS fan out, it can send it to multiple endpoints like Kinesis data, file
host delivery streams.
You have Sky, Q, you have HTTP, HTTP endpoints, Lambda functions, and so on.
So let's do one thing before we proceed further.
Let's go ahead and look into it practically.
Now for today's demo, I have a sense topic and I also have a sky.
Q You see that we have in total of two sky.
Q And both the sky Q has one message available.
So this message has been sent by SAS.
So in order to verify things are working, let's go ahead and send one more message.
Now, if you look into the subscription associated with our topic, there are two subscription and one
is associated with Q one second one is associated with Q two.
So let's go ahead and quickly publish a message.
I'll say message number two, I'll go ahead and I'll publish this message.
Now, if I'll go to the US, let's refresh the queue.
Number two has received the message.
Let's refresh once more and the queue number one has also received the message.
So this is what the fan out pattern means.
Now one more use case where you generally see fan out pattern being implemented is to replicate the
data of production to your test environment.
So what will happen is let's say that there is a sense topic and this topic is sending the message to
the production queue and this production queue is connected to the production EC two applications which
perform some operation based on these messages.
So in case if you have a testing environment, what you can do, you can go ahead and configure the
fan out pattern so that SAS can send a message to the development queue and there will be the development
EC two instance which can go ahead and process these messages locally.
So this kind of an environment also helps because when the development environment gets a copy of production
environment, it allows you to improve your application to ensure that it can work perfectly well when
migrated to production after testing grid.
So that's the high level overview and with this will conclude today's video.