welcome to get cooking and cloud where
we share the best recipes to apply in
your cloud kitchen
I am Priyanka and in today's episode
we'll share the recipe to plan for data
recovery when production environment is
on-premise or an another cloud
[Music]
Mean Street style is an e-commerce
company that has the production
environments set up on premise imagine
if they were to discover that they have
lost all the recent customer orders
during a disaster it would be a huge
loss for their business if Warriors are
not fulfilled since data is the critical
piece of their application let's dive
deeper into it and help Main Street
style with some strategies to avoid
losing data during a disaster the term
data covers two scenarios data backup
and database backups backing up data
alone involves copying a discrete amount
of data from one place to another to
recover from corruption or of
introductions down database backups on
the other hand are slightly more complex
because they typically involve
recovering to a point in time hence we
need to not just consider backing up the
database but also consider backing up
the transaction logs and then applying
them back to the database during
recovery now that we have the basic
understanding of data and database
backups 4dr let's consider Main Street
style
scenario and how they can set up dr
specifically for data for data backup
and recovery there are a few options
they can create a scheduled task that
runs the script or an application to
transfer the data to cloud storage or
they can automate a backup process to
cloud storage using gsutil command line
or by using one of the cloud storage
client libraries the other option for
data recovery is to use a third party
solution Main Street style uses the most
common tiered storage pattern where they
have the most recent backups on faster
storage and slowly migrate the older
backups to a cheaper storage when they
use Google cloud as the target they can
use cloud storage near line or cold line
as the equivalence of the storage here
one way to do this is to use a partner
gateway between on-premise storage and
cloud storage partner solutions manage
the transport from an on-premise
network-attached storage appliance or a
storage area network now that we've
learned about data storage and recovery
let's consider a database backup and
recover
I mean street-style can use a number of
strategies to implement a process to
recover a database system from
on-premise to Google cloud let's look at
two of the most common solutions they
could do a backup and recovery using a
recovery server on Google cloud or they
could use a standby server on Google
cloud for application in the recovery
server approach they would create a
database backup using the built-in
backup mechanism of the database
management system this will typically
create the backup to a local disk then
they would create a cloud storage bucket
as the target for the data backup in
Google cloud copy the backup files to
Google cloud storage using gsutil or a
partner gateway solution that we looked
at earlier also because this is a
database they would have to copy the
transaction logs to the recovery site on
Google cloud having a backup of the
transaction logs helps keep the RPO
values small then they would configure
connectivity to Google cloud using
interconnect and VPN create a custom
image of the database server on Google
cloud with exactly the same
configurations as the one on premise now
when time comes to recover to database
to the DR site on Google cloud it's easy
from Main Street style they would start
a minimally sized instance from the
custom image and attach any persistent
disks needed set the auto delete flag to
no order delete so that the persistent
disk will not be inadvertently deleted
since that could be a disaster then
applied the latest backup file and
transaction logs that we copied to cloud
storage replace the minimal instance
with the larger instance that's capable
of accepting production traffic and
finally switch the clients to point to
the recovered database in Google cloud
when a production environment
on-premises up and running they would
just have to reverse the steps take a
backup of the database and transaction
logs running on Google Cloud copy these
backup files to the production
environment and applied them to the
production database system prevent
clients from connecting to the database
system in Google cloud by stopping the
database service from this point the
application will be unavailable until
they finish restoring the
environment and finally redirect the
client connections to the production
environment and that's it
an alternative recipe is to set up a
standby server on Google Cloud for
application which helps achieve very
small RTO and RPO values since it
actually replicates data and database
State in real time to a hot standby of
the database server if Main Street style
was to setup a standby server then
here's how they would do it they would
first have to connect their on-premise
network to the Google cloud network then
create a custom image of their database
server on Google cloud in the same
configuration as the one on premise
start an instance from the custom image
and attach any persistent disks that are
needed with the auto delete flag set to
false then configure replication between
the on-premise database server and the
target database server in Google Cloud
the clients are configured in normal
operation to point to the database
server on-premise after configuring this
replication topology they would have to
switch clients to point to the standby
server running in Google cloud network
when production database on-premises up
and running they just resynchronized the
production database server with the
Google cloud database server and then
switch clients to point back to the
production environment now in our case
Main Street style has production setup
on-premises but if they have the
production setup in AWS they can use the
storage transfer service to transfer
objects from Amazon s3 to cloud storage
they could set up a transfer job to
schedule periodic synchronizations from
data source to the sink with advanced
filters based on file creation date
file name filters and the times of the
day you prefer to import data or they
can also use tools like Apache airflow
to move data between clouds well there
you have it if you have a production
application on-premise or in another
cloud and need to setup the data
recovery then hopefully you've learned
some strategies to do that that's all
for today on get cooking in cloud here's
hoping you're whipping up your own dr
star
join us next time but we will share more
recipes to implement er free data if you
would like to see more such content
don't forget to Like and subscribe to
our Channel
[Music]