1 00:00:06,873 --> 00:00:09,931 - Now let's talk about Amazon Simple Notification Service, 2 00:00:09,931 --> 00:00:11,848 otherwise known as SNS. 3 00:00:13,167 --> 00:00:15,642 With Amazon Simple Notification Service we have 4 00:00:15,642 --> 00:00:17,858 a slightly different model than what what we saw 5 00:00:17,858 --> 00:00:19,853 with the Queue Service. 6 00:00:19,853 --> 00:00:24,716 With the Queue Service it was based on putting and pulling, 7 00:00:24,716 --> 00:00:28,599 or polling and actually asking for messages, 8 00:00:28,599 --> 00:00:30,968 where they were buffered within the service. 9 00:00:30,968 --> 00:00:34,702 Here it's more of a publish/subscribe method, 10 00:00:34,702 --> 00:00:38,554 where what we do is we create what we call topics within 11 00:00:38,554 --> 00:00:41,137 the Simple Notification Service 12 00:00:42,992 --> 00:00:46,631 and then when we publish messages to those topics, 13 00:00:46,631 --> 00:00:50,798 those messages get delivered by way of either, email, 14 00:00:52,219 --> 00:00:56,386 we can deliver those messages to a HTTP or HTTPS endpoint, 15 00:00:57,999 --> 00:01:01,945 we could deliver them through mobile text message, 16 00:01:01,945 --> 00:01:04,130 through mobile push notification, 17 00:01:04,130 --> 00:01:07,713 or we could have those messages pushed into 18 00:01:08,755 --> 00:01:12,338 a queue under the Amazon Simple Queue Service. 19 00:01:12,338 --> 00:01:14,569 These would be what we would call our subscriptions. 20 00:01:14,569 --> 00:01:16,831 We would subscribe to these topics through 21 00:01:16,831 --> 00:01:18,879 these various methods. 22 00:01:18,879 --> 00:01:21,960 And again, when messages are published into those topics 23 00:01:21,960 --> 00:01:26,127 those messages or notifications are then delivered to those 24 00:01:26,967 --> 00:01:31,895 subscribers via what ever methods they had subscribed to. 25 00:01:31,895 --> 00:01:36,062 So perhaps our VideoStatus topic we want to subscribe via 26 00:01:36,908 --> 00:01:39,575 a JSON email and a text message, 27 00:01:41,482 --> 00:01:43,864 and our OrderStatus topic, 28 00:01:43,864 --> 00:01:47,905 perhaps we want to subscribe via HTTPS and we could 29 00:01:47,905 --> 00:01:51,711 subscribe a Simple Queue Service queue to that so that we 30 00:01:51,711 --> 00:01:56,691 can leverage some other system to pull from that queue and 31 00:01:56,691 --> 00:02:00,117 allow them to buffer up and pull asynchronously. 32 00:02:00,117 --> 00:02:03,088 Now, with the Simple Notification Service, it's important 33 00:02:03,088 --> 00:02:06,708 to know that the order is not guaranteed, very much like 34 00:02:06,708 --> 00:02:10,430 the Simple Queue Service, and messages are not stored. 35 00:02:10,430 --> 00:02:13,672 As soon as a message goes into a topic, and then once it's 36 00:02:13,672 --> 00:02:16,693 delivered out to its subscription endpoints, 37 00:02:16,693 --> 00:02:18,610 it is no longer stored. 38 00:02:20,008 --> 00:02:22,227 And it's also important to understand that we do have 39 00:02:22,227 --> 00:02:23,894 a 64K message limit. 40 00:02:25,824 --> 00:02:28,886 So, the Amazon Simple Notification Service is a really 41 00:02:28,886 --> 00:02:31,667 great way to get messages out. 42 00:02:31,667 --> 00:02:33,263 Perhaps you want to get messages out to 43 00:02:33,263 --> 00:02:35,256 some kind of an email system. 44 00:02:35,256 --> 00:02:38,423 You want to get a message into something like pager duty. 45 00:02:38,423 --> 00:02:41,358 You want to be notified of a cloud watch alarm. 46 00:02:41,358 --> 00:02:43,610 You want to be notified of something going on 47 00:02:43,610 --> 00:02:45,610 within your application. 48 00:02:46,597 --> 00:02:50,764 So that is the Amazon Simple Notification Service.