1 00:00:00,120 --> 00:00:02,340 So now let's talk about RDS backup. 2 00:00:02,340 --> 00:00:04,680 So first of all, you have automated backups 3 00:00:04,680 --> 00:00:06,450 and what it means that this service, 4 00:00:06,450 --> 00:00:09,930 RDS service will automatically do a daily full backup 5 00:00:09,930 --> 00:00:13,440 of the database during your database maintenance window. 6 00:00:13,440 --> 00:00:15,840 But on top of it, every five minutes 7 00:00:15,840 --> 00:00:19,320 there's going to be the transactions log being backed up. 8 00:00:19,320 --> 00:00:22,350 That means that the earliest backup you have 9 00:00:22,350 --> 00:00:24,750 is five minutes before now 10 00:00:24,750 --> 00:00:27,390 that means that from these automated backups, 11 00:00:27,390 --> 00:00:28,800 you can restore to any point 12 00:00:28,800 --> 00:00:31,500 of time up until five minutes ago. 13 00:00:31,500 --> 00:00:33,720 And for the automated backup retention 14 00:00:33,720 --> 00:00:36,973 you can say between one to 35 days of retention. 15 00:00:36,973 --> 00:00:38,970 And if you wanted to disable this feature 16 00:00:38,970 --> 00:00:43,050 you would set zero to disable automated backups. 17 00:00:43,050 --> 00:00:46,740 The second option is to do manual DB snapshots, 18 00:00:46,740 --> 00:00:48,630 manual database snapshots. 19 00:00:48,630 --> 00:00:50,640 And these, as the name indicates, 20 00:00:50,640 --> 00:00:53,340 are manually triggered by the user. 21 00:00:53,340 --> 00:00:55,170 But the benefits of it 22 00:00:55,170 --> 00:00:58,470 is that this backup that you do manually 23 00:00:58,470 --> 00:01:01,560 you can retain it for as long as you want. 24 00:01:01,560 --> 00:01:03,390 So automated backups expire 25 00:01:03,390 --> 00:01:06,450 whereas DB snapshots are manual can be retained 26 00:01:06,450 --> 00:01:07,920 for as long as you want. 27 00:01:07,920 --> 00:01:11,014 So here is a trick, when would you use backups? 28 00:01:11,014 --> 00:01:11,847 (mumbling) Backup your data 29 00:01:11,847 --> 00:01:15,180 but also if you wanna save some costs, 30 00:01:15,180 --> 00:01:17,760 So say for example, you have an RDS database 31 00:01:17,760 --> 00:01:19,620 and you know that you're going to use it 32 00:01:19,620 --> 00:01:22,170 only two hours per month. 33 00:01:22,170 --> 00:01:24,300 Instead of stopping the database 34 00:01:24,300 --> 00:01:26,250 in which, for example, you will still have to pay 35 00:01:26,250 --> 00:01:29,580 for the storage, even though your database is stopped. 36 00:01:29,580 --> 00:01:33,540 What you can do is that after using it for two hours 37 00:01:33,540 --> 00:01:38,018 you do a snapshot and then you delete the original database. 38 00:01:38,018 --> 00:01:40,864 The snapshot is costing you way less 39 00:01:40,864 --> 00:01:43,530 than the actual storage of the RDS database. 40 00:01:43,530 --> 00:01:46,320 And when you're ready to use against the database 41 00:01:46,320 --> 00:01:48,458 you would restore the snapshot and use that. 42 00:01:48,458 --> 00:01:51,363 So it's a little trick and it can come up in the exam. 43 00:01:52,710 --> 00:01:55,650 Now for Aurora backups, it is actually quite similar. 44 00:01:55,650 --> 00:01:59,550 You have automated backups from one to 35 days 45 00:01:59,550 --> 00:02:01,950 but they cannot be disabled. 46 00:02:01,950 --> 00:02:05,910 So on RDS, they could be disabled, but not on Aurora 47 00:02:05,910 --> 00:02:08,639 and you have a point in time recovery 48 00:02:08,639 --> 00:02:10,830 at any point of time in that timeframe. 49 00:02:10,830 --> 00:02:13,500 So you can recover to whatever you want. 50 00:02:13,500 --> 00:02:15,570 Now for manual DB snapshots, 51 00:02:15,570 --> 00:02:18,570 they can also be manually triggered by the user 52 00:02:18,570 --> 00:02:20,310 and you retain them for as long as you want. 53 00:02:20,310 --> 00:02:24,810 So as you can see, Aurora and RDS backups are quite similar. 54 00:02:24,810 --> 00:02:27,660 Now what about the restore options? 55 00:02:27,660 --> 00:02:30,150 The first thing is that you can restore an RDS 56 00:02:30,150 --> 00:02:33,510 or a backup or snapshots, they're the same thing, 57 00:02:33,510 --> 00:02:35,070 into a new database. 58 00:02:35,070 --> 00:02:37,548 So anytime you restore an automated backup 59 00:02:37,548 --> 00:02:42,006 or a manual snapshot, then it will create a new database. 60 00:02:42,006 --> 00:02:45,450 The other option is that we can restore a MySQL 61 00:02:45,450 --> 00:02:48,030 RDS database from S3 62 00:02:48,030 --> 00:02:49,530 and S3, we haven't seen it yet. 63 00:02:49,530 --> 00:02:52,590 It's a way to store objects in the cloud on AWS 64 00:02:52,590 --> 00:02:54,300 is a very popular service. 65 00:02:54,300 --> 00:02:57,000 And the idea is that you will create a backup 66 00:02:57,000 --> 00:03:01,223 of your on premises database and that you will place it 67 00:03:01,223 --> 00:03:04,920 onto Amazon S3, which is some object storage. 68 00:03:04,920 --> 00:03:06,690 And finally, there is the option 69 00:03:06,690 --> 00:03:09,510 in RDS to restore the backup file 70 00:03:09,510 --> 00:03:14,510 from Amazon S3 onto a new RDS instance running MySQL. 71 00:03:14,720 --> 00:03:17,130 And if you wanted to instead restore 72 00:03:17,130 --> 00:03:19,590 to a MySQL Aurora cluster, 73 00:03:19,590 --> 00:03:21,210 what you can do is that you take a backup, 74 00:03:21,210 --> 00:03:23,370 again, of your on-premises database, 75 00:03:23,370 --> 00:03:26,520 so externally and then you need to use a software 76 00:03:26,520 --> 00:03:30,540 called Percona XtraBackup, it only works with this for now 77 00:03:30,540 --> 00:03:33,690 then the backup file of Percona XtraBackup 78 00:03:33,690 --> 00:03:35,460 goes onto Amazon S3 79 00:03:35,460 --> 00:03:37,680 and from this, you can restore the backup file 80 00:03:37,680 --> 00:03:40,950 onto a new Aurora cluster running MySQL. 81 00:03:40,950 --> 00:03:44,910 So the difference here is that for restoring into RDS MySQL, 82 00:03:44,910 --> 00:03:47,490 you just need a backup of your database, 83 00:03:47,490 --> 00:03:51,030 for restoring into Aurora MySQL, 84 00:03:51,030 --> 00:03:54,330 what you need to do is to do backup using Percona XtraBackup 85 00:03:54,330 --> 00:03:59,010 and then from S3 into your Aurora DB cluster. 86 00:03:59,010 --> 00:04:01,980 Okay, so those are restore options for either the snapshots 87 00:04:01,980 --> 00:04:05,022 or the database dumps onto Amazon S3 88 00:04:05,022 --> 00:04:07,140 and finally, there is a last feature you need to know 89 00:04:07,140 --> 00:04:10,440 about called the Aurora Database Cloning. 90 00:04:10,440 --> 00:04:14,040 So it allows you to create a new Aurora DB cluster 91 00:04:14,040 --> 00:04:16,829 from an existing one, hence the name cloning. 92 00:04:16,829 --> 00:04:19,529 So say you have a production Aurora database, 93 00:04:19,529 --> 00:04:23,340 and you clone it into a new Amazon Aurora database, 94 00:04:23,340 --> 00:04:25,260 for example, a Staging Aurora 95 00:04:25,260 --> 00:04:27,930 in which you're going able to do your development 96 00:04:27,930 --> 00:04:30,900 or use test without impacting the production database. 97 00:04:30,900 --> 00:04:34,860 And it's actually faster to use the Aurora Database Cloning 98 00:04:34,860 --> 00:04:37,620 than to do a snapshot and restore. 99 00:04:37,620 --> 00:04:41,040 So the new database is going to use the same cluster volume 100 00:04:41,040 --> 00:04:42,720 and that's why it's much faster 101 00:04:42,720 --> 00:04:44,550 and then it will change over time 102 00:04:44,550 --> 00:04:47,880 as the updates are being made onto the new database. 103 00:04:47,880 --> 00:04:51,900 Therefore, database cloning is very fast, cost effective 104 00:04:51,900 --> 00:04:54,780 and it does not impact the production database 105 00:04:54,780 --> 00:04:57,750 when you do for example, create a clone 106 00:04:57,750 --> 00:05:01,740 from a production database to create a staging database. 107 00:05:01,740 --> 00:05:03,960 Okay, so it's something you need to know for the exam. 108 00:05:03,960 --> 00:05:06,960 Now you know all the backup and restore and cloning options 109 00:05:06,960 --> 00:05:09,960 for Aurora and RDS, I hope you liked it 110 00:05:09,960 --> 00:05:11,910 and I will see you in the next lecture.