1 00:00:00,270 --> 00:00:01,660 ‫Okay, so now let's talk about 2 00:00:01,660 --> 00:00:05,300 ‫the second way we can decouple our application using SNS. 3 00:00:05,300 --> 00:00:08,930 ‫So what if you want to send one message to many receivers? 4 00:00:08,930 --> 00:00:11,710 ‫We can go the route of direct integration. 5 00:00:11,710 --> 00:00:12,930 ‫For example, having a bank service 6 00:00:12,930 --> 00:00:14,860 ‫sending an email notification 7 00:00:14,860 --> 00:00:16,450 ‫then talking to a fraud service, 8 00:00:16,450 --> 00:00:18,000 ‫talking to a shipping service 9 00:00:18,000 --> 00:00:20,020 ‫and talking to the SQS queue. 10 00:00:20,020 --> 00:00:21,240 ‫But that would be quite complicated 11 00:00:21,240 --> 00:00:24,260 ‫because we need to write four direct integrations. 12 00:00:24,260 --> 00:00:25,410 ‫Instead, we can use something 13 00:00:25,410 --> 00:00:27,820 ‫called a pub/sub type of integration 14 00:00:27,820 --> 00:00:29,550 ‫in which we have an SNS topic 15 00:00:29,550 --> 00:00:31,757 ‫and the buying service will be sending a message 16 00:00:31,757 --> 00:00:34,120 ‫into our SNS topic. 17 00:00:34,120 --> 00:00:36,970 ‫And the topic automatically will be smart enough 18 00:00:36,970 --> 00:00:39,970 ‫to send a notification via email to the fraud service, 19 00:00:39,970 --> 00:00:43,340 ‫to the shipping service and even to an SQS queue. 20 00:00:43,340 --> 00:00:45,340 ‫So this is the premise of SNS. 21 00:00:45,340 --> 00:00:48,540 ‫SNS stands for Simple Notification Service 22 00:00:48,540 --> 00:00:51,450 ‫and the event publishers will only send messages 23 00:00:51,450 --> 00:00:53,150 ‫to one SNS topic. 24 00:00:53,150 --> 00:00:56,210 ‫And you can have as many event subscribers as you want 25 00:00:56,210 --> 00:00:59,110 ‫to listen to the SNS topic notifications. 26 00:00:59,110 --> 00:01:02,290 ‫Each subscriber to the topic will get all the messages. 27 00:01:02,290 --> 00:01:03,840 ‫So this is different from SQS 28 00:01:03,840 --> 00:01:05,880 ‫where the consumers were sharing the messages. 29 00:01:05,880 --> 00:01:07,940 ‫In this example, each subscriber to the topic 30 00:01:07,940 --> 00:01:11,390 ‫will get all the messages sent to the SNS topic. 31 00:01:11,390 --> 00:01:14,690 ‫Each SNS topic can have more than 12 million 32 00:01:14,690 --> 00:01:16,320 ‫subscriptions per topic 33 00:01:16,320 --> 00:01:18,510 ‫and also we have a soft limit 34 00:01:18,510 --> 00:01:21,510 ‫of 100,000 topic limits for each account. 35 00:01:21,510 --> 00:01:23,470 ‫So SNS has many destinations, 36 00:01:23,470 --> 00:01:24,970 ‫it can publish to many subscribers 37 00:01:24,970 --> 00:01:27,520 ‫and from the AWS services side 38 00:01:27,520 --> 00:01:31,320 ‫we have SQS, Lambda and Kinesis Data Firehouse 39 00:01:31,320 --> 00:01:36,320 ‫that can be all targets of our SNS publish action. 40 00:01:37,070 --> 00:01:39,870 ‫But also we can send emails directly from SNS. 41 00:01:39,870 --> 00:01:42,550 ‫We can send SMS and mobile notifications 42 00:01:42,550 --> 00:01:44,820 ‫and finally, we can send data directly 43 00:01:44,820 --> 00:01:48,260 ‫into an HTTP or HTTPS endpoint. 44 00:01:48,260 --> 00:01:50,400 ‫So bottom line is, any time in the exam 45 00:01:50,400 --> 00:01:52,960 ‫you see notification, publish subscribe, 46 00:01:52,960 --> 00:01:54,580 ‫subscribers, et cetera, et cetera. 47 00:01:54,580 --> 00:01:57,170 ‫Then think about Amazon SNS. 48 00:01:57,170 --> 00:01:58,930 ‫Okay, this is the first lecture, 49 00:01:58,930 --> 00:01:59,870 ‫I hope you liked it. 50 00:01:59,870 --> 00:02:01,820 ‫And I will see you in the next lecture.