1 00:00:00,240 --> 00:00:01,280 ‫Welcome to the section 2 00:00:01,280 --> 00:00:03,690 ‫on AWS integration and messaging. 3 00:00:03,690 --> 00:00:06,170 ‫So this section is kinda cool because we're going 4 00:00:06,170 --> 00:00:08,630 ‫to see how we can orchestrate stuff 5 00:00:08,630 --> 00:00:11,880 ‫between our different services using middleware. 6 00:00:11,880 --> 00:00:13,530 ‫And so in this section basically, 7 00:00:13,530 --> 00:00:16,100 ‫when we start to deploy multiple applications, 8 00:00:16,100 --> 00:00:18,920 ‫they will inevitably have to communicate with one another. 9 00:00:18,920 --> 00:00:22,680 ‫Okay, your services need to share information, share data. 10 00:00:22,680 --> 00:00:24,380 ‫And so there will be two patterns 11 00:00:24,380 --> 00:00:26,460 ‫of application communication out there. 12 00:00:26,460 --> 00:00:28,460 ‫There's going to be a synchronous communication 13 00:00:28,460 --> 00:00:31,140 ‫so your application will be directly connecting 14 00:00:31,140 --> 00:00:33,510 ‫to another application of yours. 15 00:00:33,510 --> 00:00:36,050 ‫And so for example we have, you know, 16 00:00:36,050 --> 00:00:38,700 ‫we sell something online, and we have a buying service, 17 00:00:38,700 --> 00:00:40,450 ‫and when something is bought, we need 18 00:00:40,450 --> 00:00:42,050 ‫to talk to the shipping service 19 00:00:42,050 --> 00:00:44,440 ‫to send that item that was just bought. 20 00:00:44,440 --> 00:00:45,740 ‫As you can see here, 21 00:00:45,740 --> 00:00:48,020 ‫my buying service and my shipping service, 22 00:00:48,020 --> 00:00:50,160 ‫they're directly connected to one another, 23 00:00:50,160 --> 00:00:52,560 ‫so there is some synchronous communication happening. 24 00:00:52,560 --> 00:00:55,230 ‫My buying service says, hey something happened, 25 00:00:55,230 --> 00:00:57,520 ‫shipping service, do it, okay? 26 00:00:57,520 --> 00:01:01,090 ‫The other type of integration and pattern 27 00:01:01,090 --> 00:01:03,750 ‫is going to be asynchronous or event based. 28 00:01:03,750 --> 00:01:06,090 ‫And so there will be a middleware called 29 00:01:06,090 --> 00:01:07,930 ‫a queue or called something else, 30 00:01:07,930 --> 00:01:10,970 ‫basically that will connect your applications. 31 00:01:10,970 --> 00:01:12,740 ‫So this time the buying service says, 32 00:01:12,740 --> 00:01:15,550 ‫hey, someone bought something, 33 00:01:15,550 --> 00:01:19,130 ‫and so I'm gonna put that into a queue, and that's it. 34 00:01:19,130 --> 00:01:21,430 ‫And the shipping service says, hey queue, 35 00:01:21,430 --> 00:01:23,620 ‫is there something that got bought recently? 36 00:01:23,620 --> 00:01:25,670 ‫And the queue will return that element 37 00:01:25,670 --> 00:01:28,310 ‫and the shipping service can do whatever it wants. 38 00:01:28,310 --> 00:01:30,820 ‫So as you can see here, the buying service 39 00:01:30,820 --> 00:01:33,950 ‫and the shipping service are not directly connected. 40 00:01:33,950 --> 00:01:35,350 ‫There is a queue in between. 41 00:01:35,350 --> 00:01:36,810 ‫And so because they don't directly talk 42 00:01:36,810 --> 00:01:39,930 ‫to one another, this is asynchronous. 43 00:01:39,930 --> 00:01:43,300 ‫Now, synchronous between applications can be 44 00:01:43,300 --> 00:01:44,360 ‫a little bit problematic sometimes, 45 00:01:44,360 --> 00:01:47,500 ‫because if one service overwhelms the other 46 00:01:47,500 --> 00:01:50,560 ‫because there is a sudden spike of purchases or whatever, 47 00:01:50,560 --> 00:01:51,970 ‫it could be a big problem right. 48 00:01:51,970 --> 00:01:53,710 ‫So if you need to encode, for example 49 00:01:53,710 --> 00:01:54,980 ‫we have a video encoding service, 50 00:01:54,980 --> 00:01:58,270 ‫and we need to encode 1,000 videos but usually it's 10. 51 00:01:58,270 --> 00:02:01,120 ‫Well, our encoding service is going to be overwhelmed 52 00:02:01,120 --> 00:02:03,040 ‫and we're going to have outages. 53 00:02:03,040 --> 00:02:05,820 ‫So, when you have these sudden spikes of traffic 54 00:02:05,820 --> 00:02:07,310 ‫or you can't predict anything, 55 00:02:07,310 --> 00:02:10,240 ‫then it's usually better to decouple your application 56 00:02:10,240 --> 00:02:13,150 ‫and have the decoupling layer scale for you. 57 00:02:13,150 --> 00:02:16,870 ‫So in that case that could be SQS for a queue model, 58 00:02:16,870 --> 00:02:19,280 ‫that could be SNS for a pub/sub model, 59 00:02:19,280 --> 00:02:22,240 ‫and that could be Kinesis, if you do real time streaming 60 00:02:22,240 --> 00:02:23,980 ‫and you have like big data. 61 00:02:23,980 --> 00:02:26,540 ‫So we'll learn all about those in this section. 62 00:02:26,540 --> 00:02:28,350 ‫And what we'll learn is that now, 63 00:02:28,350 --> 00:02:30,700 ‫using these three things, our services 64 00:02:30,700 --> 00:02:35,410 ‫can scale independently from SQS, SNS, and Kinesis. 65 00:02:35,410 --> 00:02:38,670 ‫And these three things scale as well really, really, well. 66 00:02:38,670 --> 00:02:40,050 ‫So that's the whole paradigm. 67 00:02:40,050 --> 00:02:41,540 ‫And so we're gonna get started with learning 68 00:02:41,540 --> 00:02:42,960 ‫these three technologies in this lecture. 69 00:02:42,960 --> 00:02:44,560 ‫So, see you in the next lecture.