1
00:00:00,150 --> 00:00:07,170
In this video we are going to learn probably subscribe panel pattern and topic to chaining pattern with

2
00:00:07,170 --> 00:00:09,690
using SAS case and lambda.

3
00:00:10,050 --> 00:00:12,570
Let me start with what is fanart.

4
00:00:12,570 --> 00:00:20,340
Fanart is messaging pattern where the piece of message is distributed or fanned out to multiple destination.

5
00:00:20,340 --> 00:00:21,210
In parallel.

6
00:00:21,720 --> 00:00:26,910
The main idea is each of the destinations can work and process these messages in parallel.

7
00:00:27,780 --> 00:00:34,200
One way to implement these messaging pattern is to use publisher, subscriber or pop up model.

8
00:00:34,590 --> 00:00:40,860
In the pop up model, we define a topic which is a logical access point to enable message communication

9
00:00:40,860 --> 00:00:48,690
with asynchronously a publisher simply send the message to the topic and after that this message is

10
00:00:48,690 --> 00:00:52,290
immediately sent out to all subscribers of this topic.

11
00:00:52,740 --> 00:00:56,940
These message communication is completely decoupled and asynchronously.

12
00:00:57,300 --> 00:01:03,660
Each service can operate and scale independently and individually without having any dependency of other

13
00:01:03,660 --> 00:01:04,410
services.

14
00:01:05,250 --> 00:01:11,250
The publisher doesn't need to know who is consuming this message that is broadcasting, and the subscribers

15
00:01:11,250 --> 00:01:13,800
don't need to know where the message comes from.

16
00:01:14,010 --> 00:01:19,500
The best way to build pop up messaging on a blaze is using Amazon SAS.

17
00:01:19,950 --> 00:01:24,750
Amazon SAS is fully managed, reliable and secure pop up messaging service.

18
00:01:25,200 --> 00:01:31,920
So these architectural challenges it by using messaging patterns resulting in loosely coupled communication

19
00:01:31,920 --> 00:01:36,870
between highly cohesive components to manage complexity in serverless architectures.

20
00:01:37,110 --> 00:01:38,100
A common approach.

21
00:01:38,100 --> 00:01:38,430
One.

22
00:01:38,430 --> 00:01:44,520
One component we use to deliver the same message to multiple receivers is to use the final subscribe

23
00:01:44,520 --> 00:01:47,370
messaging pattern with using Amazon Sans.

24
00:01:48,940 --> 00:01:55,780
So what is the pop up messaging, public messaging or pop up messaging is a form of asynchronous service.

25
00:01:55,780 --> 00:02:01,210
The service communication used in service and Microsoft's architectures in pop up mobile.

26
00:02:01,210 --> 00:02:07,480
Any message published to the topic is immediately received by all the subscribers to the topic pop up

27
00:02:07,480 --> 00:02:12,670
messaging can be used enabled to event driven architectures or decoupled to microservices.

28
00:02:13,210 --> 00:02:18,910
So in modern cloud architectures, applications are decoupled into smaller, independent building blocks

29
00:02:18,910 --> 00:02:21,880
that are easy to develop, deploy and maintain.

30
00:02:21,880 --> 00:02:27,760
Publish, Subscribe Messaging provides instant event notifications for these distributed applications.

31
00:02:28,480 --> 00:02:34,360
The public subscribe model allows the message to be broadcast to different parts of a system asynchronously

32
00:02:34,600 --> 00:02:40,420
a sibling to message queue a message topic provide a lightweight mechanism to broadcast asynchronous

33
00:02:40,420 --> 00:02:45,730
event notification and endpoints that allow the software components to connect to the topic in order

34
00:02:45,730 --> 00:02:47,620
to send and receive those messages.

35
00:02:47,620 --> 00:02:53,770
We have also one more design pattern, which is the topic chaining and load balancing pattern.

36
00:02:54,100 --> 00:03:00,220
So basically it is using a queue that acts as a buffer between the service from which it was called

37
00:03:00,220 --> 00:03:02,110
from the asynchronous invocations.

38
00:03:02,350 --> 00:03:08,470
By this way, we can avoid lost data if the service to fail or the task to timeout.

39
00:03:08,890 --> 00:03:14,320
This can help minimize the impact of peaks in demand on availability and responsiveness for the consumer

40
00:03:14,320 --> 00:03:15,370
microservices.

41
00:03:15,370 --> 00:03:19,360
If you look at the topic queue chaining pattern, you can see the picture on the slide.

42
00:03:19,360 --> 00:03:24,820
There are three subscriber backend services, customer notification service which interested in getting

43
00:03:24,820 --> 00:03:31,120
notified from the position microservices, customer accounting service and zero right services.

44
00:03:31,120 --> 00:03:37,030
So if one of these services can be done or getting exemption or taken offline for maintenance, then

45
00:03:37,030 --> 00:03:43,240
the event will be lost, disappeared and can process after the subscriber service is up and running

46
00:03:43,270 --> 00:03:49,390
because publishers service publish the message with file and forget method and don't avail of the service.

47
00:03:49,390 --> 00:03:51,910
Consume these events and have to process them.

48
00:03:52,060 --> 00:03:58,360
So if you subscribe from any ephemeral service like microservice or lambda functions, those services

49
00:03:58,360 --> 00:04:03,640
can potentially lose or miss topic messages from coming from the event pass.

50
00:04:04,690 --> 00:04:09,730
So at this stage, a good pattern to apply here is topic queue chaining pattern.

51
00:04:09,850 --> 00:04:12,490
So that means that you add a queue.

52
00:04:12,490 --> 00:04:19,000
In our case, we add the Amazon case queue between Amazon event page and each of the subscriber services.

53
00:04:19,000 --> 00:04:25,660
So by this way, we can store these event message into Amazon queue with the trivial and persistent

54
00:04:25,660 --> 00:04:28,240
manner and no message will get lost.

55
00:04:28,810 --> 00:04:33,850
So that means Amazon case queue can act as a buffering load balancer.
