1 00:00:00,130 --> 00:00:01,310 Okay, so let's go ahead 2 00:00:01,310 --> 00:00:04,650 and create a database with RDS. 3 00:00:04,650 --> 00:00:06,510 So RDS is going to be allowing us 4 00:00:06,510 --> 00:00:09,860 to get a manager database in the AWS cloud, 5 00:00:09,860 --> 00:00:12,210 and they get us a lot of goodness out of it 6 00:00:12,210 --> 00:00:14,800 because we don't have to manage the underlying servers, 7 00:00:14,800 --> 00:00:16,510 and we get a lot of features such as back-ups, 8 00:00:16,510 --> 00:00:19,440 replicas, multi-AZ and so on out of the box. 9 00:00:19,440 --> 00:00:21,440 So let's create a database. 10 00:00:21,440 --> 00:00:23,360 And as we can see in here, 11 00:00:23,360 --> 00:00:25,830 we have different options for creating a database. 12 00:00:25,830 --> 00:00:28,290 So we have the standard create to see all the options 13 00:00:28,290 --> 00:00:30,460 and the easy create to go fast over it. 14 00:00:30,460 --> 00:00:32,200 But because we're learning AWS, 15 00:00:32,200 --> 00:00:34,600 let's go over the standard create options. 16 00:00:34,600 --> 00:00:35,900 So we have different engine types. 17 00:00:35,900 --> 00:00:36,920 We have Aurora, 18 00:00:36,920 --> 00:00:39,410 MySQL, MariaDB, PostgreSQL, Oracle, 19 00:00:39,410 --> 00:00:41,460 and Microsoft SQL Server. 20 00:00:41,460 --> 00:00:43,200 So Aurora, we'll see later on, 21 00:00:43,200 --> 00:00:45,290 and from these five engines, 22 00:00:45,290 --> 00:00:46,240 you need to remember them all. 23 00:00:46,240 --> 00:00:48,060 So MySQL, MariaDB, 24 00:00:48,060 --> 00:00:51,290 PostgreSQL, Oracle, and Microsoft SQL Server. 25 00:00:51,290 --> 00:00:54,640 But for this demo, we're going to use MySQL. 26 00:00:54,640 --> 00:00:56,250 And then in terms of version, 27 00:00:56,250 --> 00:00:59,090 just choose whatever is recommended here. 28 00:00:59,090 --> 00:01:01,990 Okay, so next one, MySQL we have different options. 29 00:01:01,990 --> 00:01:04,900 So there are templates we can specify to meet our use case, 30 00:01:04,900 --> 00:01:07,810 which is going to be pre-filling some configuration 31 00:01:07,810 --> 00:01:08,980 parameters in here. 32 00:01:08,980 --> 00:01:12,590 So we have Production, Dev/Test or Free tier. 33 00:01:12,590 --> 00:01:14,260 And because we want to see all the options, 34 00:01:14,260 --> 00:01:16,160 I'm going to choose production 35 00:01:16,160 --> 00:01:17,740 and we're going to choose in the options one by one, 36 00:01:17,740 --> 00:01:20,740 but we'll make sure to choose an instance that is compliant 37 00:01:20,740 --> 00:01:24,150 with using the Free tier of AWS RDS. 38 00:01:24,150 --> 00:01:26,280 Okay, so for production, 39 00:01:26,280 --> 00:01:28,440 we need to specify a database identifier. 40 00:01:28,440 --> 00:01:31,120 So database-1 is great. 41 00:01:31,120 --> 00:01:34,110 Then we need to specify a master username, 42 00:01:34,110 --> 00:01:36,520 so admin is perfect. 43 00:01:36,520 --> 00:01:38,140 Then a master password, 44 00:01:38,140 --> 00:01:42,490 and I will enter password just to make it very simple. 45 00:01:42,490 --> 00:01:44,100 Okay, we're good to go. 46 00:01:44,100 --> 00:01:46,150 Then I will scroll down database class. 47 00:01:46,150 --> 00:01:48,640 Here we can choose the type of instance we want. 48 00:01:48,640 --> 00:01:50,160 So we have standard classes, 49 00:01:50,160 --> 00:01:52,380 optimized and burstable classes. 50 00:01:52,380 --> 00:01:54,670 And then you can choose the instance type, 51 00:01:54,670 --> 00:01:58,290 which is giving you a certain number of vCPU and RAM as well 52 00:01:58,290 --> 00:01:59,600 as a network speed. 53 00:01:59,600 --> 00:02:01,730 But we wanna keep things in the Free tier 54 00:02:01,730 --> 00:02:04,090 So therefore let's go into burstable classes 55 00:02:04,090 --> 00:02:06,950 and you need to choose dbt2.micro. 56 00:02:06,950 --> 00:02:09,340 So we need to include a previous generations 57 00:02:09,340 --> 00:02:11,390 and choose dbt2.micro. 58 00:02:11,390 --> 00:02:13,300 This is to make sure that you remain within 59 00:02:13,300 --> 00:02:15,850 the free tier of this hands-on. 60 00:02:15,850 --> 00:02:16,840 Next for storage, 61 00:02:16,840 --> 00:02:19,050 we need to choose GP2, but we have different options. 62 00:02:19,050 --> 00:02:20,970 We have GP2 I1 and magnetic, 63 00:02:20,970 --> 00:02:23,080 but to remain within the free tier yet again, 64 00:02:23,080 --> 00:02:25,190 we need to choose a general purpose SSD type. 65 00:02:25,190 --> 00:02:29,113 So GP2 is great with 20 gigabytes of storage. 66 00:02:29,960 --> 00:02:32,130 Okay, next, we have a very cool feature 67 00:02:32,130 --> 00:02:33,760 called storage autoscaling. 68 00:02:33,760 --> 00:02:35,060 So when we enable it, 69 00:02:35,060 --> 00:02:36,800 this provides dynamic scaling support 70 00:02:36,800 --> 00:02:38,070 for your database storage. 71 00:02:38,070 --> 00:02:39,810 So the more we use our storage, 72 00:02:39,810 --> 00:02:42,900 if we get close to 20 gigabytes automatically, 73 00:02:42,900 --> 00:02:44,990 the search will be increased by AWS 74 00:02:44,990 --> 00:02:46,280 without us doing anything. 75 00:02:46,280 --> 00:02:50,900 So this is again, UPS less type of scaling, 76 00:02:50,900 --> 00:02:53,140 and we can specify a maximum storage threshold. 77 00:02:53,140 --> 00:02:55,920 For example, 1000 gigabytes to one terabytes. 78 00:02:55,920 --> 00:02:58,240 This is very handy because we don't need to monitor 79 00:02:58,240 --> 00:02:59,073 the sort of size. 80 00:02:59,073 --> 00:03:00,610 We just know that it will automatically 81 00:03:00,610 --> 00:03:03,260 scale as the workload increases. 82 00:03:03,260 --> 00:03:05,160 Next, very, very important cool, 83 00:03:05,160 --> 00:03:07,260 availability and durability. 84 00:03:07,260 --> 00:03:08,530 So we chose production templates. 85 00:03:08,530 --> 00:03:10,200 So it was enabled by default, 86 00:03:10,200 --> 00:03:13,000 but we can disable multi-AZ for this instance. 87 00:03:13,000 --> 00:03:16,300 So multi-AZ here is that if we did enable multi-AZ, 88 00:03:16,300 --> 00:03:18,980 we would get a standby instance for our RDS database, 89 00:03:18,980 --> 00:03:21,000 which is recommended for production usage. 90 00:03:21,000 --> 00:03:23,750 And this standby instance is going to be here 91 00:03:23,750 --> 00:03:25,360 for data redundancy. 92 00:03:25,360 --> 00:03:28,350 In case you have IO freezes for backups 93 00:03:28,350 --> 00:03:32,300 and to minimize latency spikes during backups as well. 94 00:03:32,300 --> 00:03:33,780 So this is done by instance, 95 00:03:33,780 --> 00:03:36,150 it's not something that gets used by your applications. 96 00:03:36,150 --> 00:03:39,040 It's something that is yours here in case your main instance 97 00:03:39,040 --> 00:03:41,780 has an issue or a reboot or something like this. 98 00:03:41,780 --> 00:03:43,470 So for now we'll disable multi-AZ, 99 00:03:43,470 --> 00:03:45,620 but this is where the setting would be. 100 00:03:45,620 --> 00:03:47,350 Next for network settings, 101 00:03:47,350 --> 00:03:49,220 we launch it into RVPC. 102 00:03:49,220 --> 00:03:52,070 We have it when the specific certain group, 103 00:03:52,070 --> 00:03:53,620 and then we want public access. 104 00:03:53,620 --> 00:03:56,290 Yes, because we want to be able to connect to it publicly 105 00:03:56,290 --> 00:03:58,490 to test our database in this hands-on. 106 00:03:58,490 --> 00:04:01,560 And VPC security group, we can create a new security group. 107 00:04:01,560 --> 00:04:05,003 I'll call this one demo-database-mysql. 108 00:04:06,090 --> 00:04:07,900 Okay, do we have a preference for AZ? 109 00:04:07,900 --> 00:04:09,070 No preference. 110 00:04:09,070 --> 00:04:12,960 And then the port is going to be the standard port of 3306. 111 00:04:12,960 --> 00:04:14,890 Next for database authentication, 112 00:04:14,890 --> 00:04:15,740 we have three options. 113 00:04:15,740 --> 00:04:17,510 We have password authentication, 114 00:04:17,510 --> 00:04:19,800 password and IAM database authentication 115 00:04:19,800 --> 00:04:22,170 and password and Kerberos authentication. 116 00:04:22,170 --> 00:04:24,590 So important to note the second option to use 117 00:04:24,590 --> 00:04:26,830 IAM credentials, to login to RDS, 118 00:04:26,830 --> 00:04:27,750 but to keep things simple, 119 00:04:27,750 --> 00:04:30,010 I'm just going to use password authentication 120 00:04:30,010 --> 00:04:31,453 for this hands-on. 121 00:04:32,300 --> 00:04:35,550 And then we have a lot of additional configuration. 122 00:04:35,550 --> 00:04:37,390 So we can first for example, 123 00:04:37,390 --> 00:04:40,010 specify the initial database name. 124 00:04:40,010 --> 00:04:44,950 Okay, if not, then let's just specify MyDB. 125 00:04:44,950 --> 00:04:46,760 Perfect, some parameter groups 126 00:04:46,760 --> 00:04:48,360 which is out of scope for this. 127 00:04:48,360 --> 00:04:50,440 The backups, so do we want to have automatic backup? 128 00:04:50,440 --> 00:04:52,390 Yes, the backup retention periods. 129 00:04:52,390 --> 00:04:56,890 So seven days but we can specify from zero to 35 days. 130 00:04:56,890 --> 00:04:57,850 The backup window, 131 00:04:57,850 --> 00:05:00,710 so we could specify a specific window everyday to backup, 132 00:05:00,710 --> 00:05:03,140 but no preference is fine and hence monitoring 133 00:05:03,140 --> 00:05:05,650 to get more metrics from your database. 134 00:05:05,650 --> 00:05:07,820 And do we want to export the logs into CloudWatch Logs. 135 00:05:07,820 --> 00:05:09,060 We want to get the audit to the error, 136 00:05:09,060 --> 00:05:11,160 general or the slow query logs. 137 00:05:11,160 --> 00:05:11,993 The maintenance, 138 00:05:11,993 --> 00:05:14,600 so we want to enable auto minor version upgrade, yes. 139 00:05:14,600 --> 00:05:15,900 As well as we want to specify 140 00:05:15,900 --> 00:05:17,840 the maintenance window for this. 141 00:05:17,840 --> 00:05:20,060 And do we want to enable deletion protection 142 00:05:20,060 --> 00:05:23,820 to prevent us from deleting the database accidentally? 143 00:05:23,820 --> 00:05:25,250 So I'll keep this on. 144 00:05:25,250 --> 00:05:28,250 So again, this is the estimated monthly cost. 145 00:05:28,250 --> 00:05:29,330 And though, 146 00:05:29,330 --> 00:05:34,330 if we have chosen the t2.micro type of instance, 147 00:05:34,430 --> 00:05:36,150 this is within the free tier, okay. 148 00:05:36,150 --> 00:05:36,983 But just so you know, 149 00:05:36,983 --> 00:05:40,190 you may have here some estimated monthly cost shown as part 150 00:05:40,190 --> 00:05:41,190 of this UI. 151 00:05:41,190 --> 00:05:42,023 So when you're done, 152 00:05:42,023 --> 00:05:43,363 let's create this database. 153 00:05:44,800 --> 00:05:47,180 So while my database is being created, 154 00:05:47,180 --> 00:05:50,133 let's go ahead and download Sqlectron. 155 00:05:51,100 --> 00:05:53,310 And this is a SQL clients that we're going to use 156 00:05:53,310 --> 00:05:55,490 to connect to our database. 157 00:05:55,490 --> 00:05:58,720 So very simple, you're going to click on Download GUI 158 00:05:58,720 --> 00:06:00,410 and then click on it, 159 00:06:00,410 --> 00:06:02,740 take the latest version for whatever platform you have. 160 00:06:02,740 --> 00:06:05,580 So you have latest windows, 161 00:06:05,580 --> 00:06:07,990 and then for Mac is going to be a DMG. 162 00:06:07,990 --> 00:06:10,200 So I'm going to do this one, 163 00:06:10,200 --> 00:06:13,710 then open it and install it. 164 00:06:13,710 --> 00:06:15,480 Okay, so my database is now created. 165 00:06:15,480 --> 00:06:18,100 It took a little bit of time and now as you can see 166 00:06:18,100 --> 00:06:19,690 it is available. 167 00:06:19,690 --> 00:06:21,770 And so what I'm going to show you are a few options. 168 00:06:21,770 --> 00:06:22,630 So first of all, 169 00:06:22,630 --> 00:06:26,310 we have the end point right here and the port 3306, 170 00:06:26,310 --> 00:06:28,740 and it's linked to this security group 171 00:06:28,740 --> 00:06:29,710 and this Security Group, 172 00:06:29,710 --> 00:06:32,230 if you click on it and look at the Inbound rules, 173 00:06:32,230 --> 00:06:34,030 we can see that we have an inbound rule 174 00:06:34,030 --> 00:06:36,490 here on TCP port 3306. 175 00:06:36,490 --> 00:06:37,323 So that's great. 176 00:06:37,323 --> 00:06:40,580 Okay, coming from just my IP address. 177 00:06:40,580 --> 00:06:44,690 Okay, so you should of course modify this security group. 178 00:06:44,690 --> 00:06:47,310 If you have problem connecting to your database instance, 179 00:06:47,310 --> 00:06:51,160 to maybe have it to anywhere IPV C4. 180 00:06:51,160 --> 00:06:54,460 Okay, so now let's take this end points 181 00:06:54,460 --> 00:06:57,330 and we're going to connect to it using Sqlectron. 182 00:06:57,330 --> 00:07:00,230 So using Sqlectron, I'm going to add a new database. 183 00:07:00,230 --> 00:07:02,500 I'll call it RDS demo. 184 00:07:02,500 --> 00:07:05,400 It's a database of type MySQL. 185 00:07:05,400 --> 00:07:06,990 And then for the server address, 186 00:07:06,990 --> 00:07:09,970 I'm going to enter what I have over here on port 3306. 187 00:07:09,970 --> 00:07:14,020 The User is admin and the Password for me was password. 188 00:07:14,020 --> 00:07:17,330 And then the Initial Database is Mydb 189 00:07:17,330 --> 00:07:19,070 as I entered it from before. 190 00:07:19,070 --> 00:07:22,640 Let's click on Tests and the connection is successful. 191 00:07:22,640 --> 00:07:24,430 If it's not successful, please have a look 192 00:07:24,430 --> 00:07:26,300 whether or not your database was set 193 00:07:26,300 --> 00:07:28,080 to be a public database number one, 194 00:07:28,080 --> 00:07:28,913 and number two, 195 00:07:28,913 --> 00:07:30,470 have a look at your security group settings 196 00:07:30,470 --> 00:07:33,420 to make sure that your IP is allowed in. 197 00:07:33,420 --> 00:07:36,240 So let's save this and connect to our database. 198 00:07:36,240 --> 00:07:39,400 And now I'm connected into my database directly into Mydb, 199 00:07:39,400 --> 00:07:41,300 which was the database that was created. 200 00:07:41,300 --> 00:07:42,450 And in here I could go ahead 201 00:07:42,450 --> 00:07:45,260 and enter some create table statements. 202 00:07:45,260 --> 00:07:50,170 So create my table, 203 00:07:50,170 --> 00:07:55,170 and then just a name of VARCHA20 204 00:07:55,600 --> 00:07:59,763 and first name of VARCHA20. 205 00:08:00,920 --> 00:08:02,380 So it's just a very quick statement 206 00:08:02,380 --> 00:08:04,120 just to show you how SQL works, 207 00:08:04,120 --> 00:08:07,060 but this is definitely out of scope for the exam, 208 00:08:07,060 --> 00:08:07,893 execute this. 209 00:08:07,893 --> 00:08:10,410 So now we have my table that has been created, 210 00:08:10,410 --> 00:08:13,020 and then we don't have any contents in it, okay. 211 00:08:13,020 --> 00:08:16,910 But you could have an insert statement to insert some data 212 00:08:16,910 --> 00:08:17,780 into your table. 213 00:08:17,780 --> 00:08:22,370 So you would say, for example, enter the value Maarek. 214 00:08:22,370 --> 00:08:26,340 And then the value here Stephane, execute this. 215 00:08:26,340 --> 00:08:28,500 And then if you click on Select Rows, 216 00:08:28,500 --> 00:08:31,050 then you see that my table has my name and my first name 217 00:08:31,050 --> 00:08:32,500 to be Maarek and Stephane. 218 00:08:32,500 --> 00:08:36,250 So this is how we would use a RDS database with MySQL. 219 00:08:36,250 --> 00:08:37,580 But again, out of scope of the exam, 220 00:08:37,580 --> 00:08:39,039 I just want you to show you the full picture 221 00:08:39,039 --> 00:08:41,470 of using Sqlectron. 222 00:08:41,470 --> 00:08:44,710 So back in here, my art is at a base is fully managed. 223 00:08:44,710 --> 00:08:47,150 So this is great, we can use it. This is amazing. 224 00:08:47,150 --> 00:08:49,010 Other things we can do that are worthy 225 00:08:49,010 --> 00:08:51,990 are to create a replica directly from the database 226 00:08:51,990 --> 00:08:54,000 so we can create a replica. 227 00:08:54,000 --> 00:08:56,530 And then this replica would allow us 228 00:08:56,530 --> 00:08:59,710 to have more read capacity for our database, 229 00:08:59,710 --> 00:09:01,240 which will be very, very helpful. 230 00:09:01,240 --> 00:09:02,260 And do we want with our knots, 231 00:09:02,260 --> 00:09:06,290 that's a database should be multi-AZ for recovery purposes. 232 00:09:06,290 --> 00:09:08,183 So I'll keep it as no and cancel it. 233 00:09:09,150 --> 00:09:11,990 Next, we can have a look at monitoring. 234 00:09:11,990 --> 00:09:12,882 And monitoring for example, 235 00:09:12,882 --> 00:09:15,050 we could trust is CPU utilization. 236 00:09:15,050 --> 00:09:16,640 And as we can see while the CPU utilization 237 00:09:16,640 --> 00:09:17,957 is monitored by my database, 238 00:09:17,957 --> 00:09:19,730 and we can monitor this, for example, 239 00:09:19,730 --> 00:09:21,000 for scaling our database. 240 00:09:21,000 --> 00:09:23,930 If in case we have too many connections into it, 241 00:09:23,930 --> 00:09:26,050 we can have a look at the database connection counts as well 242 00:09:26,050 --> 00:09:29,607 to see how many clients are connected to into our database 243 00:09:29,607 --> 00:09:32,180 and a lot of metrics overall, okay? 244 00:09:32,180 --> 00:09:34,300 Other things you can do with RDS, 245 00:09:34,300 --> 00:09:35,800 is around creating snapshots. 246 00:09:35,800 --> 00:09:37,350 So you can take snapshots 247 00:09:37,350 --> 00:09:38,547 and this will snapshot your database 248 00:09:38,547 --> 00:09:40,620 and you can restore it wherever you want. 249 00:09:40,620 --> 00:09:43,240 You can restore to a point in time for your database, 250 00:09:43,240 --> 00:09:45,020 or you can even migrate a snapshot 251 00:09:45,020 --> 00:09:46,230 if you want to migrate a snapshot 252 00:09:46,230 --> 00:09:48,910 into a different region, for example. 253 00:09:48,910 --> 00:09:51,110 So all of these are a bunch of options that we can use, 254 00:09:51,110 --> 00:09:51,943 but as we can see, 255 00:09:51,943 --> 00:09:54,560 the whole power of RDS is to manage the database 256 00:09:54,560 --> 00:09:57,900 for us to have replicas as multi-AZ. 257 00:09:57,900 --> 00:10:01,020 We can increase the instance type as we go along and so on. 258 00:10:01,020 --> 00:10:02,490 And that's all comes very handy 259 00:10:02,490 --> 00:10:04,320 from a managed service perspective. 260 00:10:04,320 --> 00:10:07,230 So you've seen all you need to know for your RDS database. 261 00:10:07,230 --> 00:10:08,170 I hope you liked it. 262 00:10:08,170 --> 00:10:09,540 And just to finish yourself, 263 00:10:09,540 --> 00:10:12,130 please make sure to delete the database. 264 00:10:12,130 --> 00:10:13,020 To delete it, 265 00:10:13,020 --> 00:10:16,890 first you need to remove the termination protection. 266 00:10:16,890 --> 00:10:21,170 So you go to Modify, and then at the very bottom, 267 00:10:21,170 --> 00:10:22,200 you will scroll down 268 00:10:22,200 --> 00:10:24,660 and find the delete protection settings. 269 00:10:24,660 --> 00:10:29,060 So here it is, we'll disable it press and continue 270 00:10:29,060 --> 00:10:31,170 and then Apply immediately. 271 00:10:31,170 --> 00:10:34,290 And then once the delete protection is done, 272 00:10:34,290 --> 00:10:36,370 you can go ahead and delete this database. 273 00:10:36,370 --> 00:10:39,120 You can remove creating a final snapshot 274 00:10:39,120 --> 00:10:41,520 and then say delete me and acknowledge the fact 275 00:10:41,520 --> 00:10:44,010 that upon deletion everything will be lost. 276 00:10:44,010 --> 00:10:46,650 Click on Delete and you're good to go. 277 00:10:46,650 --> 00:10:48,690 So that's it for this lecture. I hope you liked it. 278 00:10:48,690 --> 00:10:50,640 And I will see you in the next lecture.