1 00:00:00,800 --> 00:00:02,190 ‫Now let's have a detailed look 2 00:00:02,190 --> 00:00:04,440 ‫at the first type of invocation for 3 00:00:04,440 --> 00:00:06,760 ‫lambda functions that we've already been using, 4 00:00:06,760 --> 00:00:09,100 ‫called the synchronous invocation. 5 00:00:09,100 --> 00:00:11,200 ‫So you're doing a synchronous invocation 6 00:00:11,200 --> 00:00:14,170 ‫when you're using the CLI, and the SDK, 7 00:00:14,170 --> 00:00:16,002 ‫the API Gateway, or even an 8 00:00:16,002 --> 00:00:17,970 ‫Application Load Balancer. 9 00:00:17,970 --> 00:00:19,490 ‫What does that mean by synchronous? 10 00:00:19,490 --> 00:00:21,530 ‫that means that you're waiting for the results, 11 00:00:21,530 --> 00:00:23,520 ‫and then the result will be returned to you. 12 00:00:23,520 --> 00:00:26,010 ‫And any errors that come backs to you 13 00:00:26,010 --> 00:00:28,520 ‫must be handled on the client side. 14 00:00:28,520 --> 00:00:30,120 ‫That means that if my lambda function fails, 15 00:00:30,120 --> 00:00:32,030 ‫and I just invoked it from the console, 16 00:00:32,030 --> 00:00:34,830 ‫I want to click on the retry button to retry it. 17 00:00:34,830 --> 00:00:36,500 ‫So that means that any time there is an error 18 00:00:36,500 --> 00:00:38,910 ‫on lambda, the client has to figure out what to do. 19 00:00:38,910 --> 00:00:40,330 ‫Do you want to retry it, do you want to do an 20 00:00:40,330 --> 00:00:42,220 ‫exponential backoff, etc etc. 21 00:00:42,220 --> 00:00:45,280 ‫So synchronous means a direct invocation 22 00:00:45,280 --> 00:00:46,890 ‫that you weight the result of. 23 00:00:46,890 --> 00:00:49,630 ‫So the CLI and the SDK would just invoke 24 00:00:49,630 --> 00:00:51,460 ‫our lambda function, the lambda function would 25 00:00:51,460 --> 00:00:54,230 ‫do something, and give us our response. 26 00:00:54,230 --> 00:00:56,490 ‫This is the same when we'll use the API Gateway 27 00:00:56,490 --> 00:00:59,696 ‫in the future sections, so the clients will invoke 28 00:00:59,696 --> 00:01:03,730 ‫the API Gateway, the API Gateway will proxy its 29 00:01:03,730 --> 00:01:05,470 ‫request to the lambda function, so it will 30 00:01:05,470 --> 00:01:08,070 ‫invoke the lambda function for you; the lambda function 31 00:01:08,070 --> 00:01:10,240 ‫will give the response to your API Gateway, 32 00:01:10,240 --> 00:01:11,480 ‫which will give you the response. 33 00:01:11,480 --> 00:01:14,500 ‫And so in this schema, we're just waiting for 34 00:01:14,500 --> 00:01:16,610 ‫the response that makes it a synchronous type of 35 00:01:16,610 --> 00:01:17,670 ‫invocation. 36 00:01:17,670 --> 00:01:20,058 ‫So, what services are synchronous with lambda? 37 00:01:20,058 --> 00:01:22,970 ‫Well, first of all, any time it's user-invoked 38 00:01:22,970 --> 00:01:24,180 ‫then it's going to be synchronous. 39 00:01:24,180 --> 00:01:25,476 ‫So: Elastic Load Balancing through the 40 00:01:25,476 --> 00:01:28,600 ‫Application Load Balancer, the API Gateway, 41 00:01:28,600 --> 00:01:31,010 ‫CloudFront with Lambda@Edge that we'll see. 42 00:01:31,010 --> 00:01:32,850 ‫Anything in bold right now is stuff we'll see 43 00:01:32,850 --> 00:01:34,780 ‫in this course, and anything not in bold 44 00:01:34,780 --> 00:01:36,090 ‫will not be seen in this course. 45 00:01:36,090 --> 00:01:37,883 ‫So Amazon S3 Batch; all the services, 46 00:01:37,883 --> 00:01:42,830 ‫such as Cognito, Step Functions, and other services: 47 00:01:42,830 --> 00:01:46,740 ‫Lex, Alexa, and Kinesis Data Firehose. 48 00:01:46,740 --> 00:01:48,720 ‫So in this section we're going to see 49 00:01:48,720 --> 00:01:50,454 ‫Application Load Balancer, API Gateway, 50 00:01:50,454 --> 00:01:52,750 ‫CloudFront, we'll see Cognito and Step Functions, 51 00:01:52,750 --> 00:01:54,670 ‫in their respective sections. 52 00:01:54,670 --> 00:01:55,503 ‫Okay. 53 00:01:55,503 --> 00:01:57,780 ‫So, now that we know what services invoke a 54 00:01:57,780 --> 00:01:59,750 ‫lambda function synchronously, let's have a play 55 00:01:59,750 --> 00:02:00,650 ‫with the hands on.