So now let's talk about RDS backup.
So first of all, you have automated backups
and what it means that this service,
RDS service will automatically do a daily full backup
of the database during your database maintenance window.
But on top of it, every five minutes
there's going to be the transactions log being backed up.
That means that the earliest backup you have
is five minutes before now
that means that from these automated backups,
you can restore to any point
of time up until five minutes ago.
And for the automated backup retention
you can say between one to 35 days of retention.
And if you wanted to disable this feature
you would set zero to disable automated backups.
The second option is to do manual DB snapshots,
manual database snapshots.
And these, as the name indicates,
are manually triggered by the user.
But the benefits of it
is that this backup that you do manually
you can retain it for as long as you want.
So automated backups expire
whereas DB snapshots are manual can be retained
for as long as you want.
So here is a trick, when would you use backups?
(mumbling) Backup your data
but also if you wanna save some costs,
So say for example, you have an RDS database
and you know that you're going to use it
only two hours per month.
Instead of stopping the database
in which, for example, you will still have to pay
for the storage, even though your database is stopped.
What you can do is that after using it for two hours
you do a snapshot and then you delete the original database.
The snapshot is costing you way less
than the actual storage of the RDS database.
And when you're ready to use against the database
you would restore the snapshot and use that.
So it's a little trick and it can come up in the exam.
Now for Aurora backups, it is actually quite similar.
You have automated backups from one to 35 days
but they cannot be disabled.
So on RDS, they could be disabled, but not on Aurora
and you have a point in time recovery
at any point of time in that timeframe.
So you can recover to whatever you want.
Now for manual DB snapshots,
they can also be manually triggered by the user
and you retain them for as long as you want.
So as you can see, Aurora and RDS backups are quite similar.
Now what about the restore options?
The first thing is that you can restore an RDS
or a backup or snapshots, they're the same thing,
into a new database.
So anytime you restore an automated backup
or a manual snapshot, then it will create a new database.
The other option is that we can restore a MySQL
RDS database from S3
and S3, we haven't seen it yet.
It's a way to store objects in the cloud on AWS
is a very popular service.
And the idea is that you will create a backup
of your on premises database and that you will place it
onto Amazon S3, which is some object storage.
And finally, there is the option
in RDS to restore the backup file
from Amazon S3 onto a new RDS instance running MySQL.
And if you wanted to instead restore
to a MySQL Aurora cluster,
what you can do is that you take a backup,
again, of your on-premises database,
so externally and then you need to use a software
called Percona XtraBackup, it only works with this for now
then the backup file of Percona XtraBackup
goes onto Amazon S3
and from this, you can restore the backup file
onto a new Aurora cluster running MySQL.
So the difference here is that for restoring into RDS MySQL,
you just need a backup of your database,
for restoring into Aurora MySQL,
what you need to do is to do backup using Percona XtraBackup
and then from S3 into your Aurora DB cluster.
Okay, so those are restore options for either the snapshots
or the database dumps onto Amazon S3
and finally, there is a last feature you need to know
about called the Aurora Database Cloning.
So it allows you to create a new Aurora DB cluster
from an existing one, hence the name cloning.
So say you have a production Aurora database,
and you clone it into a new Amazon Aurora database,
for example, a Staging Aurora
in which you're going able to do your development
or use test without impacting the production database.
And it's actually faster to use the Aurora Database Cloning
than to do a snapshot and restore.
So the new database is going to use the same cluster volume
and that's why it's much faster
and then it will change over time
as the updates are being made onto the new database.
Therefore, database cloning is very fast, cost effective
and it does not impact the production database
when you do for example, create a clone
from a production database to create a staging database.
Okay, so it's something you need to know for the exam.
Now you know all the backup and restore and cloning options
for Aurora and RDS, I hope you liked it
and I will see you in the next lecture.