1 00:00:00,230 --> 00:00:02,060 ‫Okay, so let's go ahead and practice 2 00:00:02,060 --> 00:00:03,000 ‫DynamoDB a little bit. 3 00:00:03,000 --> 00:00:05,030 ‫So I'm going to create a table, 4 00:00:05,030 --> 00:00:06,647 ‫and I'll call this one DemoTable. 5 00:00:06,647 --> 00:00:08,500 ‫Now in DynamoDB what you need to do 6 00:00:08,500 --> 00:00:12,210 ‫is specify a partition key, so specify user_id, 7 00:00:12,210 --> 00:00:14,410 ‫and sort keys are definitely out of scope for the exam, 8 00:00:14,410 --> 00:00:16,820 ‫so let's just consider just the partition key. 9 00:00:16,820 --> 00:00:19,500 ‫Okay, so, now for the settings in DynamoDB, again, 10 00:00:19,500 --> 00:00:21,020 ‫I'm going to leave it as a default settings, 11 00:00:21,020 --> 00:00:23,430 ‫you don't need to know the details of how it works, 12 00:00:23,430 --> 00:00:26,740 ‫and then you scroll down and you click on Create table. 13 00:00:26,740 --> 00:00:28,720 ‫So our table is now creating, 14 00:00:28,720 --> 00:00:31,130 ‫and what I'm going to notice is that we are creating 15 00:00:31,130 --> 00:00:33,580 ‫a table without creating a database. 16 00:00:33,580 --> 00:00:36,170 ‫So the database already exists, it's serverless, 17 00:00:36,170 --> 00:00:38,220 ‫we don't need to provision servers. 18 00:00:38,220 --> 00:00:39,053 ‫We just want you to say, 19 00:00:39,053 --> 00:00:42,440 ‫"Hey, look, I want this table, please create it for me 20 00:00:42,440 --> 00:00:44,190 ‫and I don't care how it's being run." 21 00:00:44,190 --> 00:00:46,210 ‫And that's the whole power of DynamoDB, 22 00:00:46,210 --> 00:00:48,850 ‫that's the whole power of serverless services. 23 00:00:48,850 --> 00:00:50,680 ‫So now that the table is ready 24 00:00:50,680 --> 00:00:53,360 ‫we can click on View items, and practice a little bit 25 00:00:53,360 --> 00:00:55,290 ‫inserting some data into this table. 26 00:00:55,290 --> 00:00:57,040 ‫So currently zero items are returned 27 00:00:57,040 --> 00:00:58,750 ‫because I haven't created anything, 28 00:00:58,750 --> 00:01:01,090 ‫but we can create an item in DynamoDB. 29 00:01:01,090 --> 00:01:03,740 ‫And for user_id I can say 1234, 30 00:01:03,740 --> 00:01:05,350 ‫so that will be my user ID. 31 00:01:05,350 --> 00:01:08,730 ‫We can have a first name to be equal to Stephane, 32 00:01:08,730 --> 00:01:13,730 ‫and we can have a last name to be equal to Maarek, 33 00:01:13,770 --> 00:01:16,040 ‫and then, finally, we could have a number. 34 00:01:16,040 --> 00:01:19,030 ‫So I can see lot of different types we can have, by number, 35 00:01:19,030 --> 00:01:22,740 ‫and it could be my favorite number, and it's 42, 36 00:01:22,740 --> 00:01:24,163 ‫and click on Create item. 37 00:01:25,750 --> 00:01:29,040 ‫And here we go, my item was written into DynamoDB. 38 00:01:29,040 --> 00:01:30,770 ‫So this is super easy, yet, again, 39 00:01:30,770 --> 00:01:33,370 ‫I do not have to specify any database, just my table, 40 00:01:33,370 --> 00:01:34,830 ‫write some item, and so on. 41 00:01:34,830 --> 00:01:36,430 ‫And we didn't have to specify this schema, 42 00:01:36,430 --> 00:01:37,850 ‫it just get automatically inferred, 43 00:01:37,850 --> 00:01:40,610 ‫now we have four attributes or columns. 44 00:01:40,610 --> 00:01:43,800 ‫Now if I can create a second item, so 45678, 45 00:01:43,800 --> 00:01:47,520 ‫and then add a new string, so, for example, first_name. 46 00:01:47,520 --> 00:01:51,230 ‫In here we're going to have Alice, and click on Create item. 47 00:01:51,230 --> 00:01:53,090 ‫So, as we can see, in this example, 48 00:01:53,090 --> 00:01:56,280 ‫I didn't specify a favorite number or last name for Alice, 49 00:01:56,280 --> 00:01:58,020 ‫I just specified first name Alice, 50 00:01:58,020 --> 00:02:00,570 ‫and it was still accepted by DynamoDB. 51 00:02:00,570 --> 00:02:02,750 ‫So it's a very flexible type of database, 52 00:02:02,750 --> 00:02:05,020 ‫it's a very flexible way to insert data, 53 00:02:05,020 --> 00:02:08,370 ‫and this whole, like, test sets of features 54 00:02:08,370 --> 00:02:12,120 ‫and particularities make DynamoDB really, really good. 55 00:02:12,120 --> 00:02:14,660 ‫But the difference between DynamoDB and, say, RDS 56 00:02:14,660 --> 00:02:16,760 ‫is that DynamoDB will have all the data 57 00:02:16,760 --> 00:02:18,410 ‫living within one single table, 58 00:02:18,410 --> 00:02:21,090 ‫and there's no way to join it with another table. 59 00:02:21,090 --> 00:02:22,380 ‫So it's not a relational database, 60 00:02:22,380 --> 00:02:24,650 ‫that's when DynamoDB is a non SQL database, 61 00:02:24,650 --> 00:02:27,310 ‫so not only SQL database, so NoSQL. 62 00:02:27,310 --> 00:02:28,902 ‫And the idea, here, is that, yes, 63 00:02:28,902 --> 00:02:31,600 ‫we cannot link this table to another table, 64 00:02:31,600 --> 00:02:33,423 ‫so we need to make sure that all the relevant data 65 00:02:33,423 --> 00:02:36,640 ‫is well formatted within our main DynamoDB table. 66 00:02:36,640 --> 00:02:37,473 ‫So it changes a little bit 67 00:02:37,473 --> 00:02:40,860 ‫how you see database designs and so on. 68 00:02:40,860 --> 00:02:43,150 ‫But that's it for DynamoDB, a very quick hands-on 69 00:02:43,150 --> 00:02:45,990 ‫to show you an overview, but with DynamoDB 70 00:02:45,990 --> 00:02:49,400 ‫it's a lot more to learn and this is the focus 71 00:02:49,400 --> 00:02:51,230 ‫of the Certified Developer exam, 72 00:02:51,230 --> 00:02:52,480 ‫not the Cloud Practitioner exam. 73 00:02:52,480 --> 00:02:54,450 ‫So, for this example, this is enough, 74 00:02:54,450 --> 00:02:55,900 ‫and when you're done and ready 75 00:02:55,900 --> 00:02:57,410 ‫you can just delete the table. 76 00:02:57,410 --> 00:02:59,020 ‫You can delete all the CloudWatch alarms 77 00:02:59,020 --> 00:03:01,680 ‫associated with it, and just type delete in this box 78 00:03:01,680 --> 00:03:02,950 ‫and you'll be good to go. 79 00:03:02,950 --> 00:03:05,030 ‫So that's it for this lecture, I hope you liked it, 80 00:03:05,030 --> 00:03:06,980 ‫and I will see you in the next lecture.