1 00:00:06,534 --> 00:00:08,420 - Alright, now let's run through a demo 2 00:00:08,420 --> 00:00:11,949 of creating a table in Amazon DynamoDB. 3 00:00:11,949 --> 00:00:16,164 You can see we're back here in the AWS Console. 4 00:00:16,164 --> 00:00:19,250 From the Services menu item, 5 00:00:19,250 --> 00:00:22,003 because I've been to DynamoDB before, 6 00:00:22,003 --> 00:00:25,673 you can see that it shows up here in the History. 7 00:00:25,673 --> 00:00:28,081 I could also get to it by going over here 8 00:00:28,081 --> 00:00:29,914 to Database, DynamoDB. 9 00:00:31,385 --> 00:00:33,893 Once we're here, we're seeing this screen 10 00:00:33,893 --> 00:00:37,811 because we don't have any tables in the Ohio region yet. 11 00:00:37,811 --> 00:00:40,986 So I'm gonna go ahead and hit Create table. 12 00:00:40,986 --> 00:00:43,819 I'm gonna call the table "movies". 13 00:00:44,934 --> 00:00:49,223 And if you recall what we talked about with data models, 14 00:00:49,223 --> 00:00:52,375 we need some kind of primary key. 15 00:00:52,375 --> 00:00:55,510 For the data that we're gonna be working with, 16 00:00:55,510 --> 00:00:58,951 we'd want a composite primary key 17 00:00:58,951 --> 00:01:03,173 that is the combination of a partition key and a sort key. 18 00:01:03,173 --> 00:01:06,759 In this particular case, the partition key will be the year 19 00:01:06,759 --> 00:01:10,079 and we will make that a number. 20 00:01:10,079 --> 00:01:13,406 The sort key will be the title, 21 00:01:13,406 --> 00:01:16,156 and we'll leave that as a string. 22 00:01:17,950 --> 00:01:22,417 From here, we could leave the default settings 23 00:01:22,417 --> 00:01:25,760 or we could uncheck that and make some changes here. 24 00:01:25,760 --> 00:01:28,817 You'll see now secondary indexes are something 25 00:01:28,817 --> 00:01:33,513 that we could add to add further indexes of our data. 26 00:01:33,513 --> 00:01:35,809 These secondary indexes need to be added 27 00:01:35,809 --> 00:01:38,148 at the time we create the table. 28 00:01:38,148 --> 00:01:42,101 We could also change the provision capacity. 29 00:01:42,101 --> 00:01:45,995 It defaults to five read and five write capacity units. 30 00:01:45,995 --> 00:01:49,729 So if you expect your table to be a write-heavy table 31 00:01:49,729 --> 00:01:51,645 and not do much reading from it, 32 00:01:51,645 --> 00:01:55,248 then you might say you want 50 write capacity units 33 00:01:55,248 --> 00:01:57,593 but only five reads. 34 00:01:57,593 --> 00:01:58,916 That would be up to you. 35 00:01:58,916 --> 00:02:01,333 It can be difficult to determine that upfront, 36 00:02:01,333 --> 00:02:04,900 so perhaps a good approach is to just make 37 00:02:04,900 --> 00:02:09,304 your best educated guess and leverage monitoring 38 00:02:09,304 --> 00:02:12,532 over a period of time to see if you need to come back 39 00:02:12,532 --> 00:02:15,216 and adjust those capacities. 40 00:02:15,216 --> 00:02:19,057 So for now, I'm just gonna leave these as five and five. 41 00:02:19,057 --> 00:02:21,613 And you can see that at these low capacities, 42 00:02:21,613 --> 00:02:25,780 this table should only cost less than three dollars a month. 43 00:02:27,851 --> 00:02:31,148 I'm gonna go ahead and click Create, 44 00:02:31,148 --> 00:02:34,148 and that table is now being created. 45 00:02:35,380 --> 00:02:39,265 So you can see that DynamoDB makes it really easy 46 00:02:39,265 --> 00:02:43,432 to create tables that are inherently highly available, 47 00:02:44,711 --> 00:02:46,743 durable, fault tolerant. 48 00:02:46,743 --> 00:02:49,370 We know that the data is gonna be replicated. 49 00:02:49,370 --> 00:02:52,460 And based on SSD drives, we know that we're gonna get 50 00:02:52,460 --> 00:02:54,927 predictable, fast performance. 51 00:02:54,927 --> 00:02:57,691 So Amazon Web Services has done a really good job 52 00:02:57,691 --> 00:03:02,131 of creating a very easy NoSQL service with DynamoDB. 53 00:03:02,131 --> 00:03:06,298 So that's it for creating a table in Amazon DynamoDB.