1 00:00:00,360 --> 00:00:02,100 So let's get started with an overview 2 00:00:02,100 --> 00:00:03,810 of AWS RDS. 3 00:00:03,810 --> 00:00:07,650 RDS stands for relational database service. 4 00:00:07,650 --> 00:00:10,650 And what it means is that it's a managed database service 5 00:00:10,650 --> 00:00:15,150 for database that use SQL as a query language. 6 00:00:15,150 --> 00:00:17,850 So SQL is a structured language to query database. 7 00:00:17,850 --> 00:00:21,630 It's very well adapted and it's running on many engines. 8 00:00:21,630 --> 00:00:23,280 So it allows you to create databases, 9 00:00:23,280 --> 00:00:24,780 the RDS service in the cloud. 10 00:00:24,780 --> 00:00:27,030 And these databases will be managed by AWS 11 00:00:27,030 --> 00:00:29,520 and you get a lot of benefits from it. 12 00:00:29,520 --> 00:00:32,580 So what types of database engine are managed by AWS? 13 00:00:32,580 --> 00:00:34,530 Well, the first one is Postgres SQL, 14 00:00:34,530 --> 00:00:37,890 then we have MySQL, MariaDB, Oracle, 15 00:00:37,890 --> 00:00:40,620 Microsoft SQL Server, and finally Aurora. 16 00:00:40,620 --> 00:00:43,080 And we have a dedicated section to Aurora, 17 00:00:43,080 --> 00:00:45,894 so right now you can just forget about it. 18 00:00:45,894 --> 00:00:47,940 So the first five, Postgres, MySQL, 19 00:00:47,940 --> 00:00:50,610 MariaDB, Oracle and Microsoft SQL Server, 20 00:00:50,610 --> 00:00:52,560 you have to remember them. 21 00:00:52,560 --> 00:00:54,720 So why would we use RDS, 22 00:00:54,720 --> 00:00:57,090 versus deploying our own database service 23 00:00:57,090 --> 00:01:00,840 on top of, say an EC2 instance, because this is possible? 24 00:01:00,840 --> 00:01:02,820 Well, RDS is a managed service. 25 00:01:02,820 --> 00:01:05,459 And as such, AWS provides a lot of services 26 00:01:05,459 --> 00:01:07,830 on top of just giving us a database. 27 00:01:07,830 --> 00:01:10,080 For example, the provisioning of the database 28 00:01:10,080 --> 00:01:11,310 is fully automated 29 00:01:11,310 --> 00:01:14,640 and so is the underlying operating system patching. 30 00:01:14,640 --> 00:01:16,830 There is continuous backups being made 31 00:01:16,830 --> 00:01:20,160 and you are able to restore to a specific timestamp, 32 00:01:20,160 --> 00:01:22,500 it's called point in time restore. 33 00:01:22,500 --> 00:01:23,940 You can also have monitoring dashboards 34 00:01:23,940 --> 00:01:25,830 to view the performance of your database. 35 00:01:25,830 --> 00:01:27,090 You can have read replicas 36 00:01:27,090 --> 00:01:28,980 and we have a dedicated lecture on read replicas 37 00:01:28,980 --> 00:01:31,530 in this course to improve read performance. 38 00:01:31,530 --> 00:01:32,760 You can set up a Multi AZ. 39 00:01:32,760 --> 00:01:34,950 And so we do have also sections on Multi AZ, 40 00:01:34,950 --> 00:01:37,410 that will be helpful for disaster recovery. 41 00:01:37,410 --> 00:01:40,020 You have maintenance windows for the upgrades 42 00:01:40,020 --> 00:01:41,940 and you have scaling capabilities, 43 00:01:41,940 --> 00:01:45,000 both vertical by increasing the instance type 44 00:01:45,000 --> 00:01:47,610 and horizontal by adding read replicas. 45 00:01:47,610 --> 00:01:49,590 Finally, the storage is backed by EBS. 46 00:01:49,590 --> 00:01:51,180 So this is something we already know, 47 00:01:51,180 --> 00:01:53,880 which is gp2 volumes or io1. 48 00:01:53,880 --> 00:01:55,950 But the only thing we do not have 49 00:01:55,950 --> 00:02:00,510 is we cannot SSH into the instances, the RDS instances. 50 00:02:00,510 --> 00:02:02,640 So because this is a managed service, 51 00:02:02,640 --> 00:02:03,780 AWS provides us a service 52 00:02:03,780 --> 00:02:07,470 and we don't have access to the underlying EC2 instance, 53 00:02:07,470 --> 00:02:09,690 but this is not too bad because we get all these things 54 00:02:09,690 --> 00:02:11,370 that we would have to set up on our own 55 00:02:11,370 --> 00:02:15,990 if we wanted to deploy our own database engine on EC2. 56 00:02:15,990 --> 00:02:18,570 So let's talk about RDS backups for a little bit. 57 00:02:18,570 --> 00:02:21,570 Backups are automatically enabled in RDS 58 00:02:21,570 --> 00:02:23,190 and you have automated backups. 59 00:02:23,190 --> 00:02:25,230 They're daily full backups of the database, 60 00:02:25,230 --> 00:02:26,970 which are done during the maintenance window 61 00:02:26,970 --> 00:02:27,803 that you define. 62 00:02:27,803 --> 00:02:30,960 And then the transaction logs, the daily transaction logs, 63 00:02:30,960 --> 00:02:33,780 are backed up by RDS every five minutes. 64 00:02:33,780 --> 00:02:36,390 So these two things together gives you the ability 65 00:02:36,390 --> 00:02:39,660 to restore to any point in time your database 66 00:02:39,660 --> 00:02:43,170 from all this backup, all the way to what happened, 67 00:02:43,170 --> 00:02:45,360 up to five minutes ago. 68 00:02:45,360 --> 00:02:48,360 There is a seven day retention of these automated backups 69 00:02:48,360 --> 00:02:51,990 by default, but it can be increased to 35 days. 70 00:02:51,990 --> 00:02:53,700 And you have database snapshots. 71 00:02:53,700 --> 00:02:55,830 So snapshots are slightly different from backups, 72 00:02:55,830 --> 00:02:59,070 snapshots are backups that are manually triggered 73 00:02:59,070 --> 00:03:01,650 by the user and the backup retention, 74 00:03:01,650 --> 00:03:04,860 so these snapshot retention is as long as you want. 75 00:03:04,860 --> 00:03:07,740 So they're more helpful if you wanted to retain the state 76 00:03:07,740 --> 00:03:11,283 of your database for six month at some point in time. 77 00:03:12,330 --> 00:03:14,610 So here is one feature that can come up in the exam 78 00:03:14,610 --> 00:03:17,370 and is around RDS storage auto-scaling. 79 00:03:17,370 --> 00:03:19,380 So the idea is that when you create an RDS database, 80 00:03:19,380 --> 00:03:20,790 you need to say how much storage you want. 81 00:03:20,790 --> 00:03:23,700 For example, you want 20 gigabytes of storage, 82 00:03:23,700 --> 00:03:26,370 but say you are using your database a lot 83 00:03:26,370 --> 00:03:28,560 and you're about to run out of free space, 84 00:03:28,560 --> 00:03:30,540 then with this feature enabled, 85 00:03:30,540 --> 00:03:33,510 the RDS storage auto-scaling, RDS will detect that 86 00:03:33,510 --> 00:03:35,970 and will scale automatically the storage for you, 87 00:03:35,970 --> 00:03:38,400 so you don't have to do any kind of operations, 88 00:03:38,400 --> 00:03:41,640 such as taking line database to increase the storage. 89 00:03:41,640 --> 00:03:43,560 So the idea is that your application does a lot 90 00:03:43,560 --> 00:03:45,660 of read and writes to your RDS database 91 00:03:45,660 --> 00:03:48,420 and then automatically with some threshold, 92 00:03:48,420 --> 00:03:51,270 we'll see in a second, then the storage can auto-scale 93 00:03:51,270 --> 00:03:52,680 and that is a feature of RDS. 94 00:03:52,680 --> 00:03:54,480 That is a very, very nice feature. 95 00:03:54,480 --> 00:03:58,620 So this always meant to make you avoid the operation 96 00:03:58,620 --> 00:04:01,920 of scaling manually your database storage. 97 00:04:01,920 --> 00:04:04,800 For this, you need to set a maximum storage threshold, 98 00:04:04,800 --> 00:04:07,320 so a maximum limit for how much you want the storage to grow 99 00:04:07,320 --> 00:04:09,870 'cause you don't want it to grow infinitely, maybe. 100 00:04:09,870 --> 00:04:12,030 And you can automatically modify storage 101 00:04:12,030 --> 00:04:14,520 if the free storage is less than 10% 102 00:04:14,520 --> 00:04:16,380 of what has been allocated. 103 00:04:16,380 --> 00:04:17,910 And the low storage has been lasting 104 00:04:17,910 --> 00:04:19,560 for more than five minutes 105 00:04:19,560 --> 00:04:22,920 and six hours have passed since the last modification. 106 00:04:22,920 --> 00:04:23,753 If that's the case, 107 00:04:23,753 --> 00:04:26,400 then the storage will auto increase when you enable it. 108 00:04:26,400 --> 00:04:28,950 This is very helpful for applications 109 00:04:28,950 --> 00:04:31,500 that have unpredictable workload. 110 00:04:31,500 --> 00:04:34,530 And this supports all database engines for RDS, 111 00:04:34,530 --> 00:04:37,590 just as MariaDB, MySQL, Postgres SQL, 112 00:04:37,590 --> 00:04:39,780 SQL Server and Oracle. 113 00:04:39,780 --> 00:04:41,430 So that's it for this lecture, I hope you liked it. 114 00:04:41,430 --> 00:04:43,380 And I will see you in the next lecture.