1
00:00:00,240 --> 00:00:06,960
In this section we are going to learn Ada Lovelace, Lambda working with events and ADA Islam, the

2
00:00:06,960 --> 00:00:09,420
base practices and event driven architectures.

3
00:00:09,750 --> 00:00:11,220
So let's get started.

4
00:00:12,860 --> 00:00:18,020
Abdoulaye Islam is very good fit with the event driven architectures because the nature of the lambda

5
00:00:18,020 --> 00:00:20,390
executions triggered from events.

6
00:00:20,810 --> 00:00:25,160
Events can come loads of the resources unable to trigger lambda functions.

7
00:00:26,000 --> 00:00:32,000
A Duelist Lambda is a complete service that runs custom function code and returns response to the events.

8
00:00:32,660 --> 00:00:39,350
Most advantageous sources generate events for communicating each other, and most of the services are

9
00:00:39,350 --> 00:00:41,720
event sources for lambda functions.

10
00:00:42,540 --> 00:00:43,050
A do list.

11
00:00:43,050 --> 00:00:49,080
Lamda always handle all the interactions with the Lambda API and there is no direct invocation of functions

12
00:00:49,080 --> 00:00:50,730
from outside to service.

13
00:00:50,760 --> 00:00:56,640
We can also see in the image on the slide lambda handle the events with the Lambda API.

14
00:00:56,670 --> 00:01:04,150
The main purpose of lambda function is handle the events when a function is triggered by an event.

15
00:01:04,170 --> 00:01:06,120
This is called an invocation.

16
00:01:06,150 --> 00:01:13,770
Lambda function are limited to 15 minutes in duration, but on average most calls take less than a second

17
00:01:13,770 --> 00:01:15,810
across all eight customers.

18
00:01:16,350 --> 00:01:22,200
In some compute instead of operations, it may take several minutes to process a single event, but

19
00:01:22,200 --> 00:01:24,360
in most cases the time is short.

20
00:01:25,620 --> 00:01:31,620
An event triggering a lambda function could be almost anything you can see in the image from the rest.

21
00:01:31,620 --> 00:01:38,700
API http request with Amazon API Gateway Schedule Task Management by Amazon Event Rule or Amazon S3

22
00:01:38,700 --> 00:01:41,430
notification like object uploaded in the bucket.

23
00:01:41,610 --> 00:01:46,230
Even the simplest lambda based application use at least one event.

24
00:01:46,530 --> 00:01:48,600
So that's why we set that.

25
00:01:48,630 --> 00:01:55,620
A lambda is very good fit for event driven architectures because the full of the lambda is events.

26
00:01:57,180 --> 00:02:01,770
The event is adjacent object that contains all information about what happened.

27
00:02:02,010 --> 00:02:08,640
Events are represents a change in the system state they are immutable so we can see the example event

28
00:02:08,640 --> 00:02:12,330
JSON to trigger a lambda function in the slide image.

29
00:02:12,360 --> 00:02:17,670
The first parameter of every lambda handle function contains the event JSON object.

30
00:02:17,670 --> 00:02:21,810
So here you can find the example event JSON object that triggered to lambda function.

31
00:02:21,810 --> 00:02:27,780
You can see the function image that that takes event parameter into lambda 100 method.

32
00:02:28,050 --> 00:02:33,450
So at that stage, the event parameter is very important when developing your lambda functions.

33
00:02:33,690 --> 00:02:39,750
If we look at the Lambda 100 method, we will see that the first parameter is event into lambda handed

34
00:02:39,780 --> 00:02:40,230
method.

35
00:02:40,230 --> 00:02:46,980
So with using this event JSON object, we can access the event parameters into the lambda function.

36
00:02:46,980 --> 00:02:50,220
For example, let's look at the slide image we have.

37
00:02:50,220 --> 00:02:53,550
We have new order event triggers to lambda function.

38
00:02:53,550 --> 00:03:00,330
So if I would like to get the order that detail attribute value into lambda function, basically I can

39
00:03:00,330 --> 00:03:03,570
take information with the event, that source event to detail.

40
00:03:03,600 --> 00:03:08,850
We can use these attribute information reachable from the event dot notation.

41
00:03:09,360 --> 00:03:15,150
So as you can see that we can reach the event at source and event that detail from the event object

42
00:03:15,150 --> 00:03:18,990
of the lambda parameters lambda 100 function.

43
00:03:19,080 --> 00:03:25,830
We can reach these entities because lambda triggered with this event JSON object with passing parameter

44
00:03:25,830 --> 00:03:27,000
into another method.

45
00:03:28,290 --> 00:03:36,030
An event could be custom generated from another microservices such as Native Order generated in the

46
00:03:36,030 --> 00:03:37,350
ecommerce application.

47
00:03:37,350 --> 00:03:43,230
We will have exact the same use case into our service ecommerce application in the upcoming lectures.

48
00:03:43,530 --> 00:03:48,300
The event also can be generated from existing sources like Amazon.

49
00:03:48,480 --> 00:03:51,660
Case one A new queue message is available in the queue.

50
00:03:51,750 --> 00:03:57,590
It can go to Lambda with pulling queue records from the space event.

51
00:03:57,590 --> 00:04:03,630
Event architectures rely on creating events into all application state chains and that are observable

52
00:04:03,630 --> 00:04:04,890
by other services.

53
00:04:04,890 --> 00:04:09,960
But even publisher system is unaware of which consumer are subscribing that event.

54
00:04:09,990 --> 00:04:16,800
We can call that these are the loosely coupled services most lambda based applications use a combination

55
00:04:16,800 --> 00:04:23,490
of services for different requirements about storage, API management and integrating with other systems

56
00:04:23,490 --> 00:04:24,480
and services.

57
00:04:25,110 --> 00:04:31,410
In these examples applications, Lambda is connecting between services, providing business logic to

58
00:04:31,410 --> 00:04:34,500
transform data that moves between microservices.

59
00:04:36,990 --> 00:04:43,350
So we set that solar certification, mostly using a combination of several sources that integrated with

60
00:04:43,350 --> 00:04:47,070
custom code, running the lambda functions and communicating with events.

61
00:04:47,850 --> 00:04:52,710
We can find mostly integrated sources with using the lambda functions.

62
00:04:52,770 --> 00:04:54,690
You can see the image on the slide.

63
00:04:54,720 --> 00:05:01,050
These sources are most commonly used in-service applications with lambda functions.

64
00:05:01,110 --> 00:05:04,980
You can see the categories and services in the compute category.

65
00:05:05,010 --> 00:05:11,540
We have a double lambda in the test storage, Amazon, S3, Dynamo DB and Rrd's in API management.

66
00:05:11,550 --> 00:05:14,230
We have API Gateway in control.

67
00:05:14,250 --> 00:05:20,130
In integration layer, we have SANS creates an event which in orchestration layer we have state functions

68
00:05:20,130 --> 00:05:20,820
and so on.

69
00:05:21,420 --> 00:05:25,110
So we will also use these services into our service hands on labs.

70
00:05:25,110 --> 00:05:30,840
But before that we should clearly understand that how this lambda events works and how we can use events

71
00:05:30,840 --> 00:05:34,830
into our Node.js function codes using the event object.

72
00:05:35,070 --> 00:05:36,390
Let's get started.
