1 00:00:07,130 --> 00:00:08,260 - Welcome. 2 00:00:08,260 --> 00:00:09,690 In this demonstration, 3 00:00:09,690 --> 00:00:12,260 we are going to deploy a DynamoDB table 4 00:00:12,260 --> 00:00:14,103 using the AWS console. 5 00:00:15,090 --> 00:00:16,602 Now I'm in the console home 6 00:00:16,602 --> 00:00:21,272 and I can then just search for DynamoDB 7 00:00:21,272 --> 00:00:25,253 in the list and go straight to the dashboard there. 8 00:00:26,380 --> 00:00:28,212 Now, as we pull this up for the first time, 9 00:00:28,212 --> 00:00:31,340 we always get a little announcement here or there, 10 00:00:31,340 --> 00:00:32,890 we can go ahead and close that out 11 00:00:32,890 --> 00:00:35,950 to give us a little bit more screen real estate. 12 00:00:35,950 --> 00:00:38,863 There are a number of options down the left hand side. 13 00:00:39,720 --> 00:00:44,550 We have tables, backups, exports, capacity, 14 00:00:44,550 --> 00:00:48,860 DynamoDB accelerator, and so forth, but we're gonna go here 15 00:00:48,860 --> 00:00:50,300 to the bright orange button. 16 00:00:50,300 --> 00:00:51,313 Create table. 17 00:00:52,500 --> 00:00:55,656 Table creation in DynamoDB can be as simple 18 00:00:55,656 --> 00:00:58,580 or as complicated as you make it. 19 00:00:58,580 --> 00:01:00,910 We're gonna start with a table name 20 00:01:00,910 --> 00:01:04,010 and let's call this a shopping cart 21 00:01:04,010 --> 00:01:09,010 for the back end of an eCommerce application. 22 00:01:09,900 --> 00:01:14,880 So this will be the persistent storage when customers 23 00:01:14,880 --> 00:01:19,053 are modifying their cart to get ready for checkout. 24 00:01:21,060 --> 00:01:24,823 Every table in DynamoDB needs a partition key. 25 00:01:25,830 --> 00:01:29,940 The partition key is one of the attributes 26 00:01:29,940 --> 00:01:34,940 of every item that makes up a unique element 27 00:01:35,480 --> 00:01:40,480 that allows AWS to partition the underlying data 28 00:01:41,720 --> 00:01:44,450 to achieve the best performance. 29 00:01:44,450 --> 00:01:46,830 You can think of the partition key 30 00:01:46,830 --> 00:01:51,820 almost as a primary key, but if it's not unique, 31 00:01:51,820 --> 00:01:55,010 then you have to add a second attribute into the mix. 32 00:01:55,010 --> 00:01:59,063 And the combination of them make a primary key. 33 00:02:00,470 --> 00:02:02,690 From a strategy perspective, 34 00:02:02,690 --> 00:02:07,690 this partition key needs to exhibit high cardinality. 35 00:02:09,250 --> 00:02:14,040 Cardinality can be described as when you have a large range 36 00:02:15,100 --> 00:02:19,940 of potential values for the key and a relative 37 00:02:19,940 --> 00:02:24,860 even distribution across that range. 38 00:02:24,860 --> 00:02:29,860 And so if we were to choose date, that has a high range 39 00:02:31,070 --> 00:02:36,070 of values, but the actual values are going to be limited 40 00:02:37,700 --> 00:02:40,950 to the most recent data. 41 00:02:40,950 --> 00:02:45,643 And so instead, why don't we go ahead and select username, 42 00:02:47,140 --> 00:02:51,320 especially if we use this as emails for our e-commerce site 43 00:02:51,320 --> 00:02:54,940 this does tend to exhibit pretty high cardinality 44 00:02:54,940 --> 00:02:56,930 and we'll leave it as a string. 45 00:02:56,930 --> 00:02:57,763 And in that case, 46 00:02:57,763 --> 00:02:59,440 because the username is unique, 47 00:02:59,440 --> 00:03:01,993 we do not need a sort key at all. 48 00:03:03,950 --> 00:03:05,300 Now we have the option here 49 00:03:05,300 --> 00:03:09,390 of accepting default settings or customizing. 50 00:03:09,390 --> 00:03:13,030 So let's click on customize, which changes the form. 51 00:03:13,030 --> 00:03:16,420 And we have the ability to deploy our table class 52 00:03:16,420 --> 00:03:20,760 as either standard or infrequent access. 53 00:03:20,760 --> 00:03:25,657 If you've worked with other services like S3 or EFS, 54 00:03:26,890 --> 00:03:31,890 both of those services also exhibit storage classes. 55 00:03:32,580 --> 00:03:35,760 The standard IA storage class is always going 56 00:03:35,760 --> 00:03:39,690 to be cheaper for storing data, 57 00:03:39,690 --> 00:03:42,960 but if it's going to be accessed on a regular basis, 58 00:03:42,960 --> 00:03:45,090 we will want it in dynamo DB standard. 59 00:03:45,090 --> 00:03:47,840 So that's what we're going to configure for this table. 60 00:03:49,150 --> 00:03:50,860 So we go down a little bit further. 61 00:03:50,860 --> 00:03:52,410 We have capacity settings 62 00:03:52,410 --> 00:03:54,560 and this is where we have a number of choices. 63 00:03:54,560 --> 00:03:57,324 Do we want to provision our table 64 00:03:57,324 --> 00:04:02,010 for a specific number of reads and writes? 65 00:04:02,010 --> 00:04:03,530 We can do that. 66 00:04:03,530 --> 00:04:07,430 And if we configure provisioned capacity, 67 00:04:07,430 --> 00:04:11,010 we can then choose to scale as well. 68 00:04:11,010 --> 00:04:13,400 So with auto scaling off, 69 00:04:13,400 --> 00:04:17,513 we just get provisioned capacity and everything is static. 70 00:04:18,920 --> 00:04:23,920 With auto scaling on, we configure a minimum, a maximum, 71 00:04:25,080 --> 00:04:27,163 and then a target utilization. 72 00:04:28,730 --> 00:04:31,110 However, if we don't want to configure this 73 00:04:31,110 --> 00:04:36,110 for reads and writes, we can simply click on demand and all 74 00:04:36,720 --> 00:04:40,820 of those options go away and AWS will scale according 75 00:04:40,820 --> 00:04:44,830 to the load, with no minimums or maximums. 76 00:04:44,830 --> 00:04:46,850 This next section is where we have the ability 77 00:04:46,850 --> 00:04:49,490 to create local, secondary indexes 78 00:04:49,490 --> 00:04:52,030 or global secondary indexes that can allow us 79 00:04:52,030 --> 00:04:54,700 to achieve higher performance 80 00:04:54,700 --> 00:04:57,253 or organize the table in different ways. 81 00:04:59,420 --> 00:05:04,350 Encryption at rest, we have choices of keys 82 00:05:04,350 --> 00:05:07,860 but not a choice to turn it off. 83 00:05:07,860 --> 00:05:12,410 So we can choose AWS owning the entire chain of trust. 84 00:05:12,410 --> 00:05:16,956 We can do an AWS manage key, which is the default CMK 85 00:05:16,956 --> 00:05:21,333 in KMS for our region, or we can manage our own. 86 00:05:22,490 --> 00:05:25,000 So we can leave this at the default. 87 00:05:25,000 --> 00:05:28,450 The table itself does not cost us anything. 88 00:05:28,450 --> 00:05:30,480 We'll add a cost center anyway. 89 00:05:30,480 --> 00:05:33,118 It's only the data in the table 90 00:05:33,118 --> 00:05:36,643 that causes pricing to be applied. 91 00:05:38,000 --> 00:05:42,350 And so at this point, we can go in, click on create table. 92 00:05:42,350 --> 00:05:47,210 And if we refresh, our table is still creating 93 00:05:47,210 --> 00:05:48,270 and now it's active. 94 00:05:48,270 --> 00:05:50,010 So it really doesn't take very long. 95 00:05:50,010 --> 00:05:53,810 And then we can start using our table almost immediately. 96 00:05:53,810 --> 00:05:55,783 And that completes this demonstration.