1 00:00:00,210 --> 00:00:02,540 So now let's create an Aurora database. 2 00:00:02,540 --> 00:00:03,600 So we'll use standard create 3 00:00:03,600 --> 00:00:05,830 to have all the options available to us 4 00:00:05,830 --> 00:00:08,340 and we'll choose Amazon Aurora. 5 00:00:08,340 --> 00:00:10,630 So, we have two editions of Aurora, 6 00:00:10,630 --> 00:00:13,340 we have Aurora MySQL-Compatible Edition, 7 00:00:13,340 --> 00:00:15,890 or Aurora PostgreSQL-Compatible Edition. 8 00:00:15,890 --> 00:00:19,200 For this, I'm going to use Aurora MySQL-Compatible Edition 9 00:00:19,200 --> 00:00:21,270 because there are more features to show you. 10 00:00:21,270 --> 00:00:22,770 So first of all, the capacity type. 11 00:00:22,770 --> 00:00:25,000 And we'll see some advanced features in the next lecture 12 00:00:25,000 --> 00:00:27,260 but we can have a look at a preview 13 00:00:27,260 --> 00:00:29,270 at them in this hands-on. 14 00:00:29,270 --> 00:00:31,360 So we either provision and we manage 15 00:00:31,360 --> 00:00:34,300 the server instance sizes, or we have serverless 16 00:00:34,300 --> 00:00:37,300 and then automatically, Aurora will scale the capacity 17 00:00:37,300 --> 00:00:40,010 based on the database load, which is a great option 18 00:00:40,010 --> 00:00:43,090 for intermittent or unpredictable workloads. 19 00:00:43,090 --> 00:00:45,450 So to keep things simple, I'm going to use it as provision 20 00:00:45,450 --> 00:00:46,870 because it does give us more option 21 00:00:46,870 --> 00:00:49,630 but serverless is quite a heavy feature. 22 00:00:49,630 --> 00:00:51,450 Then we have replication feature 23 00:00:51,450 --> 00:00:52,880 and currently we have single-master, 24 00:00:52,880 --> 00:00:53,810 which is what I told you, 25 00:00:53,810 --> 00:00:57,500 that we can write only to a single writer instance, 26 00:00:57,500 --> 00:00:59,960 which is good for general purpose option 27 00:00:59,960 --> 00:01:01,530 for most workloads, okay? 28 00:01:01,530 --> 00:01:05,580 But then if you have multi-master you supports to write 29 00:01:05,580 --> 00:01:07,800 to multiple writer instances 30 00:01:07,800 --> 00:01:08,810 and this is good when you have 31 00:01:08,810 --> 00:01:11,940 continuous writer availability that is required. 32 00:01:11,940 --> 00:01:14,580 Now, to keep it with as many options as possible, 33 00:01:14,580 --> 00:01:16,710 I will keep it as a single-master. 34 00:01:16,710 --> 00:01:19,170 Next, we have the engine version, as you can see, 35 00:01:19,170 --> 00:01:21,790 we can choose from 53 versions right now. 36 00:01:21,790 --> 00:01:23,510 And we have different version here 37 00:01:23,510 --> 00:01:26,660 but each version supports different kinds of features. 38 00:01:26,660 --> 00:01:28,380 And actually there's some filter. 39 00:01:28,380 --> 00:01:30,177 So if you use this filter, you can say, 40 00:01:30,177 --> 00:01:32,647 "Hey, I only wanna see versions that supports 41 00:01:32,647 --> 00:01:34,600 "the global database feature," 42 00:01:34,600 --> 00:01:36,650 which is to spend an Aurora database 43 00:01:36,650 --> 00:01:38,920 across multiple areas, regions, 44 00:01:38,920 --> 00:01:41,410 or we want to only show versions that support 45 00:01:41,410 --> 00:01:43,580 the parallel query feature and so on. 46 00:01:43,580 --> 00:01:46,690 So, for this, I'm going to just show versions 47 00:01:46,690 --> 00:01:48,880 that support the global database feature 48 00:01:48,880 --> 00:01:52,390 and choose whatever Amazon Aurora recommends for me. 49 00:01:52,390 --> 00:01:54,240 So I'll choose this one, for example. 50 00:01:55,760 --> 00:01:57,770 So next I'm going to scroll down 51 00:01:57,770 --> 00:01:58,650 and we have different templates, 52 00:01:58,650 --> 00:02:00,070 so production or Dev/Test, 53 00:02:00,070 --> 00:02:00,903 as you can see, 54 00:02:00,903 --> 00:02:03,080 there is no free feature for Aurora. 55 00:02:03,080 --> 00:02:06,100 So we'll use production and see all these features, 56 00:02:06,100 --> 00:02:09,699 So the database identifier is going to be database-2. 57 00:02:09,699 --> 00:02:11,850 Then the username is going to be admin, 58 00:02:11,850 --> 00:02:14,560 the password again is going to be password. 59 00:02:14,560 --> 00:02:16,053 So let me enter a password. 60 00:02:17,840 --> 00:02:19,040 Then I will scroll down. 61 00:02:20,230 --> 00:02:22,530 And here we choose the database instance class. 62 00:02:22,530 --> 00:02:25,470 So we have memory and burstable classes 63 00:02:25,470 --> 00:02:28,250 where we trying to keep the cost as low as possible 64 00:02:28,250 --> 00:02:29,530 if you want to follow along. 65 00:02:29,530 --> 00:02:32,520 So choose a dB.t3.small with me, 66 00:02:32,520 --> 00:02:35,393 which is the smallest instance that you can have right now. 67 00:02:36,470 --> 00:02:38,890 But again, if you go ahead and create a database, 68 00:02:38,890 --> 00:02:41,600 just make sure that you are going to incur some costs. 69 00:02:41,600 --> 00:02:43,900 Next, for availability and durability. 70 00:02:43,900 --> 00:02:46,160 So do you want to create a Multi-AZ deployment? 71 00:02:46,160 --> 00:02:48,260 And obviously this is best practice. 72 00:02:48,260 --> 00:02:49,093 So you can say, 73 00:02:49,093 --> 00:02:50,850 "No, I don't want to have an Aurora replica," 74 00:02:50,850 --> 00:02:52,477 or "Yes, please set up an or replica, 75 00:02:52,477 --> 00:02:54,360 "or reader node in a different AC," 76 00:02:54,360 --> 00:02:55,193 and I'm going to do it, 77 00:02:55,193 --> 00:02:57,613 which is recommended for scaled availability. 78 00:02:57,613 --> 00:02:59,010 This is going to give you fast, 79 00:02:59,010 --> 00:03:01,200 failover and high availability. 80 00:03:01,200 --> 00:03:03,560 But of course, it's going to cost you more money. 81 00:03:03,560 --> 00:03:06,760 No matter what, if you don't use an Aurora replica, 82 00:03:06,760 --> 00:03:09,620 just know that your storage layer is no matter what, 83 00:03:09,620 --> 00:03:13,370 replicated across three AZ, that's a guarantee. 84 00:03:13,370 --> 00:03:16,410 So I will choose to create an Aurora replica, perfect. 85 00:03:16,410 --> 00:03:19,260 Then a VPC, a sub-net group. 86 00:03:19,260 --> 00:03:20,700 Do you want to make it publicly accessible? 87 00:03:20,700 --> 00:03:21,533 Yes or no. 88 00:03:21,533 --> 00:03:22,510 I'm not going to access it. 89 00:03:22,510 --> 00:03:24,410 So I'm not going to say yes, but you could, 90 00:03:24,410 --> 00:03:26,060 if you wanted to. 91 00:03:26,060 --> 00:03:27,610 Next, a security group. 92 00:03:27,610 --> 00:03:29,750 I will select a new security group, I'll call it, 93 00:03:29,750 --> 00:03:32,540 demo-aurora-mysql, 94 00:03:32,540 --> 00:03:35,630 which is all gain on port 3306. 95 00:03:35,630 --> 00:03:37,440 Now for database authentication, 96 00:03:37,440 --> 00:03:40,460 we can access Aurora using either a password, which we know, 97 00:03:40,460 --> 00:03:42,410 or a password and IAM database authentication, 98 00:03:42,410 --> 00:03:44,160 which is very handy as well. 99 00:03:44,160 --> 00:03:45,470 We have additional options, 100 00:03:45,470 --> 00:03:47,330 which is just specify initial database names, 101 00:03:47,330 --> 00:03:49,600 for example, my DB, sometime it's our groups, 102 00:03:49,600 --> 00:03:52,045 which is out of scope. 103 00:03:52,045 --> 00:03:54,300 Failover again, is out of scope. 104 00:03:54,300 --> 00:03:57,080 Backup is just how many days you should retain backups 105 00:03:57,080 --> 00:03:57,913 for this instance. 106 00:03:57,913 --> 00:03:59,590 So one day is good enough 107 00:03:59,590 --> 00:04:01,610 but you have all the way to 35 days. 108 00:04:01,610 --> 00:04:03,190 Do we want to increase the database? Yes. 109 00:04:03,190 --> 00:04:04,230 And with what key? 110 00:04:04,230 --> 00:04:05,760 This one is perfect. 111 00:04:05,760 --> 00:04:08,200 Do we want to backtrack this database quickly 112 00:04:08,200 --> 00:04:09,033 in point of timing? 113 00:04:09,033 --> 00:04:10,530 In which case you need to say, 114 00:04:10,530 --> 00:04:14,163 yes, I'd like to enable backtrack for my database 115 00:04:14,163 --> 00:04:16,240 and say up to 72 hours, 116 00:04:16,240 --> 00:04:18,769 I wanna be able to backtrack back in time. 117 00:04:18,769 --> 00:04:21,269 But you can disable it as well, I'll disable it. 118 00:04:21,269 --> 00:04:22,600 Do we want to have an enhanced monitoring? 119 00:04:22,600 --> 00:04:25,980 Do you have a more greener IOT on your monitoring? Yes. 120 00:04:25,980 --> 00:04:27,030 What do you want to do with the logs? 121 00:04:27,030 --> 00:04:29,240 Do you want to send them to CloudWatch logs? Yes. 122 00:04:29,240 --> 00:04:31,080 Maintenance, maintenance window, we know this 123 00:04:31,080 --> 00:04:34,020 and whether or not we want to enable deletion protection. 124 00:04:34,020 --> 00:04:36,240 This time I will disable this. 125 00:04:36,240 --> 00:04:37,880 Now let's create this database, 126 00:04:37,880 --> 00:04:38,713 and as you can see, 127 00:04:38,713 --> 00:04:40,260 it's going to take a little bit of time. 128 00:04:40,260 --> 00:04:43,890 So what I'm going to do is pause the video while it happens. 129 00:04:43,890 --> 00:04:47,380 So my Aurora database is created. 130 00:04:47,380 --> 00:04:49,630 And as we can see, we have regional cluster 131 00:04:49,630 --> 00:04:52,590 with a writer instance and a reader instance. 132 00:04:52,590 --> 00:04:54,840 So here, the important fact is that, 133 00:04:54,840 --> 00:04:58,010 we have different instance to write and to read from, 134 00:04:58,010 --> 00:04:59,370 and they're in different AZ. 135 00:04:59,370 --> 00:05:01,490 So this is the whole power of Aurora. 136 00:05:01,490 --> 00:05:03,290 So if you click on Database 2. 137 00:05:03,290 --> 00:05:06,200 As we can see to connect, we have two end points. 138 00:05:06,200 --> 00:05:10,380 We have a reader end points and a writer end point. 139 00:05:10,380 --> 00:05:11,780 So these end points are very handy 140 00:05:11,780 --> 00:05:13,330 because they represent an endpoint 141 00:05:13,330 --> 00:05:16,150 that will always lead to the right reader instance, 142 00:05:16,150 --> 00:05:17,220 a writer instance, 143 00:05:17,220 --> 00:05:19,810 and this end points will always lead 144 00:05:19,810 --> 00:05:21,510 to the right reader instance. 145 00:05:21,510 --> 00:05:23,210 So these end points is what your application 146 00:05:23,210 --> 00:05:26,260 should be using to connect to Aurora. 147 00:05:26,260 --> 00:05:28,100 But if you were to click directly 148 00:05:28,100 --> 00:05:30,160 on this specific instance right here, 149 00:05:30,160 --> 00:05:33,000 this instance will have also a dedicated end points. 150 00:05:33,000 --> 00:05:35,810 And that instance over here would also have 151 00:05:35,810 --> 00:05:38,910 a dedicated end points, once it is being created. 152 00:05:38,910 --> 00:05:41,310 So it's all being in the creating space. 153 00:05:41,310 --> 00:05:43,349 So we have these features that are cool. 154 00:05:43,349 --> 00:05:45,750 Vic, we have other features. 155 00:05:45,750 --> 00:05:50,350 So we can add more readers into our reader cluster 156 00:05:50,350 --> 00:05:53,180 to add on with scaling capacity. 157 00:05:53,180 --> 00:05:55,690 And we can also create a cross-Region read replica, 158 00:05:55,690 --> 00:05:58,330 if you want to have a replica in another region. 159 00:05:58,330 --> 00:06:00,670 We can restore any point in time. 160 00:06:00,670 --> 00:06:04,480 And another one is that we could add replica auto scaling. 161 00:06:04,480 --> 00:06:06,930 So this one is very important because well, 162 00:06:06,930 --> 00:06:09,667 we can create a policy and this policy would say, 163 00:06:09,667 --> 00:06:12,100 "Hey, based on the average CPU utilization 164 00:06:12,100 --> 00:06:13,640 of your Aurora Replica, 165 00:06:13,640 --> 00:06:15,100 or the average number of connections 166 00:06:15,100 --> 00:06:16,380 to your Aurora Replica, 167 00:06:16,380 --> 00:06:18,680 then scale your Read Replica." 168 00:06:18,680 --> 00:06:23,077 So say, ReadReplicaScalingPolicy and say, 169 00:06:23,077 --> 00:06:25,470 "I want you to make sure that my Replica stay 170 00:06:25,470 --> 00:06:27,060 at a target value of 60%, 171 00:06:27,060 --> 00:06:30,360 And if I go over, please create more Read Replica. 172 00:06:30,360 --> 00:06:32,450 We could also define a scale in period 173 00:06:32,450 --> 00:06:34,730 for discovering policy, which makes sense. 174 00:06:34,730 --> 00:06:36,380 And what's the min and the max capacity. 175 00:06:36,380 --> 00:06:40,010 So one Replica up to 15 Aurora Replicas. 176 00:06:40,010 --> 00:06:41,983 And this is very handy to have Read Replica 177 00:06:41,983 --> 00:06:44,223 auto-scaling as a database. 178 00:06:45,080 --> 00:06:47,490 So I canceled it, we don't need it right now. 179 00:06:47,490 --> 00:06:51,540 And now I've made sure that both my database 180 00:06:51,540 --> 00:06:53,430 and end points are available, 181 00:06:53,430 --> 00:06:54,590 So we're good to go. 182 00:06:54,590 --> 00:06:56,580 So one last thing I can do to show you 183 00:06:56,580 --> 00:06:58,920 the whole power of Aurora is to do action 184 00:06:58,920 --> 00:07:00,630 and add AWS Region, 185 00:07:00,630 --> 00:07:03,740 and this is only possible if you chose a version of Aurora 186 00:07:03,740 --> 00:07:07,170 that was enabled with the global database feature. 187 00:07:07,170 --> 00:07:12,170 But here we can add the database region to other regions 188 00:07:12,220 --> 00:07:14,390 and this will allow you each get a global Aurora. 189 00:07:14,390 --> 00:07:16,800 Now, as you can see, this is not possible with this cluster, 190 00:07:16,800 --> 00:07:20,110 because we need to have an instance with a compatible size. 191 00:07:20,110 --> 00:07:22,080 To do this first, I need to change the instance, 192 00:07:22,080 --> 00:07:24,830 for example, to a large type of instance 193 00:07:24,830 --> 00:07:27,100 and then we would be able to add other regions 194 00:07:27,100 --> 00:07:27,970 to the database cluster. 195 00:07:27,970 --> 00:07:30,883 But anyway, I wanted to show you the feature right here. 196 00:07:31,760 --> 00:07:33,070 So that's it for Aurora, 197 00:07:33,070 --> 00:07:34,440 this is pretty much what you get, 198 00:07:34,440 --> 00:07:37,510 which is an amazing database with amazing performance. 199 00:07:37,510 --> 00:07:41,400 Great scaling capacity global and so on, serverless. 200 00:07:41,400 --> 00:07:42,730 So really, really complete database. 201 00:07:42,730 --> 00:07:44,840 I really liked this offering from AWS. 202 00:07:44,840 --> 00:07:46,400 Now to be done with this hands-on, 203 00:07:46,400 --> 00:07:48,770 just take this database and you want to delete it, 204 00:07:48,770 --> 00:07:50,460 but as you can see, it's not available. 205 00:07:50,460 --> 00:07:52,580 So what you need to do first is to delete 206 00:07:52,580 --> 00:07:54,040 the reader instance. 207 00:07:54,040 --> 00:07:56,290 So type it delete me, 208 00:07:56,290 --> 00:07:58,970 then you need to delete the writer instance. 209 00:07:58,970 --> 00:08:03,240 So again, action, delete and then you type delete me. 210 00:08:03,240 --> 00:08:06,070 And then once both of these things are deleted, 211 00:08:06,070 --> 00:08:08,590 you are going to be able to delete your whole cluster. 212 00:08:08,590 --> 00:08:10,380 So I will wait when it's done. 213 00:08:10,380 --> 00:08:12,300 That's it, my database is now deleted 214 00:08:12,300 --> 00:08:14,323 and I will see you in the next lecture.