This content explains how to protect data and manage costs in Google Cloud Storage by utilizing object versioning, retention policies, and lifecycle management rules.
Mind Map
Clique para expandir
Clique para explorar o mapa mental interativo completo
hello hi everyone Welcome to Cloud
Sprint in the last video we learned how
to choose location or the classes of the
buckets we also did some case study if
you have not watched that video link is
in the description do watch that as well
in this video we are going to learn that
how to protect our data in Cloud Google
cloud storage and how to save the cost
by enabling bucket versioning policies
we'll also do some use cases so watch it
till the end [Music]
[Music]
while working on Google Cloud Storage
your main job is to protect your data
and Google Cloud Storage offers us some
techniques to protect our data the first
one is object versioning feature it
basically supports the retrieval of
objects that are deleted or replaced in
this feature you can enable that your
version one two three four is maintained
and if you delete version one you still
have version 2 available for your users
this will protect you from any
accidental deletion the second option is
the retention policy retention policy
prevents the deletion or modification of
the buckets for a specified minimum
period of time after that they are
uploaded which means that you cannot
delete or modify a object or file once
you have uploaded in the bucket this
will help you to protect your data for a
specific period of time and controlling
that it's not deleted let's go ahead to
the console and find that out in detail
over here we will come to cloud storage
and we'll click on create this will
create a bucket for us once you create
on it you'll be asked to give a unique
name which is globally unique so I'll
say cloud Sprint
continue in the last video we learned
that how to choose location so let's say
I say Regional continue we also
understood that how to when to choose
which storage class for now let's keep
it default which is standard we also
learned about that what is uniform and
fine-grained axis and how to enforce
Public Access prevention on this bucket
the major part which we are talking in
this video is about how to protect your
data okay your data is always protected
with class students but you need to
choose additional data protection
options to prevent the data loss and gcp
offers us two options object versioning
and retention policy if you want to
store your data for data recovery if you
want that something is deleted I should
be able to recover that then you will be
using object versioning you can have
that maximum number of versions per
object you can configure that suppose
you just want to save last five versions
and expand non-current version
non-current version means which is not
the live object that's the difference so
once suppose a is your current version
and you overwrite it with B so a becomes
a non-current version and B becomes
light version that's the difference so
you want that a to be deleted after
seven days this will help you to save
the cost otherwise you will have you
know n number of versions per object and
that will add to the cost in your you
don't want that to happen
that's all about object versioning this
will help you to survive any accidental deletion
deletion
second option is retention policy as the
title says it is best for compliance if
you want to prevent the deletion or
modification of the buckets object for a
specific minimum duration of time after
being uploaded which means that you want
that object should not be deleted for 30
days nobody should be able to modify or
delete the objects within this bucket
because you have some compliance to be
fulfilled that X data must be available
for 30 days in a bucket you don't want
any this happened to be there because if
someone reads the data you lose that
compliance and you might have to pay
some files so in those kind of scenarios
you will be using the retention policy
if you don't want to protect your data
you can just choose none I hope these
two options are clear now versioning is
for data recovery retention policy is
mostly for best compliance and you
configure it while creating the market
one very very important point to note
here if you delete the bucket
if an honor deletes the bucket these
policies do not work
okay so be very very careful whom you
are giving what kind of access that is
why the earlier five six videos which I
have made on IM is very very important
if you have not checked them out go
ahead and check them out as well this is
how you're gonna protect your data
uh using these options and this will
help you to work more efficiently and
you can choose as per your need while
creating the buckets
let's go back to the presentation I hope
this is clear now that how you can
protect your data over gcp storage the
next option which Google Cloud Storage
offers is life cycle policies life cycle
rules let you apply actions to a bucket
objects when certain conditions are met
for example switching objects to a
colder storage class when they reach or
pass a certain age this life cycle will
help you on many front these policies
will help you to save costs also help
you to optimize your utilization
just a quick recap on the
storage classes and all we have standard
we have near line
for 30 days we have gold line for 90
days and we have archival for 365 days
now imagine a situation you have
a data a shopping history data which is
just used for 30 days suppose after 30
days you might use or might not use for
next one year and after one year you
want that data to be deleted
in that case this life cycle policies
will work on your behalf you can just
create a Json or you can configure it
from console or from your terraform
however you're going to create the
bucket what you'll do you'll create a
life cycle policies that keep the
objects in this bucket as a standard
resource for 30 days after that move it
to archival
and once the object Edge completes 365
days you can delete it
see how how powerful this tool can be done
done
you don't have to you don't have to take
care of each object the Google Cloud
Storage will take care of itself and it
will move it will change the classes for
the objects and it will delete it as
well when as and when needed how you
configure it
let's go ahead and check this on the
console as well let's go ahead and see
how the life cycle policies work in the
last while while understanding the
protection of data
we check these options okay let's create
confirm
it will create a bucket for me quickly
over here you need to go to lifecycle
we already have two rule existing
because we selected it's you need to
delete the objects all non-currents five
plus newer versions and seven plus days
when it becomes non-current
now I'll go ahead and add a rule because
I want to move something to code Line storage
storage
okay I want that whenever X thing
happens that X thing that condition will
choose here but I my job is to move the
objects to code line after this object
conditions met which we'll select in the
next window so my first job is to select
what kind of action I want to take I
want to move the objects to code Line
storage click on continue
when do you want this to happen you need
to choose that condition you want it on
the edge you want to create it before
the class match any if any new version
becomes available the live stage what is
your ask that's the main thing so I'll
say that okay let's choose it over age
as long as it becomes 90 days
okay clear I'm saying as any object age
becomes 90 days move it to core Line
storage click on create
you'll see this rule is created
and it will be attached to this bucket
which is cloud Sprint bucket
this is a third Rule now that you file
is is 90 days the class of that
particular object will be set to code line
line
let's add another rule okay
okay
this time I want to choose a life cycle
policy like I want to delete an object
click on continue when
say when the age of the file becomes 365 days
days
so whenever any object or a file
age becomes 365 days it should get
deleted automatically I'll say continue
I'll say create
you can see that delete object 365 plus
days since the object was updated means
that any object which is uh which is 365
days plus days old will be automatically
deleted because you don't need that file
right that's the point of creating
lifecycle policy that you can take the
leverage of the classes available and
you can take the benefits out of it you
can protect your data you can save cost
okay that's how you you configure a life
cycle you can delete all
in single click also check protection
once that object versioning is enabled
here we already enabled it you can also
manage rule this object versioning and
retention policy they don't work hand in
hand because of course it's
contradictory because at one place
you're saying that you cannot modify
something and at other place you're
saying you want to save multiple
versions so they can't work together
either you'll enable this or you'll
enable this
okay this is how you configure lifecycle
and you protect your data and your
objects can be uploaded here
all right
let's go back to the presentation okay I
hope that was helpful when to use which
class how to move it how to create a
life cycle and how to attach it to a
bucket this concludes all four Concepts
what you need to know is knowing the
location the classes the protection and
the life cycle let's go ahead and do a
case study now the case study says
there's a cost of your application logs
are exceeding the project bill which
means whatever logs you are generating
from your application is exceeding the
project field these logs are used by
teams regularly for 30 days and might be
used for some audit purpose once in
every quarter development team is using
these logs maximum for 30 days to test
or to check how your application have
behaved after that it's not used
frequently but it might be needed for
some audit purpose every quarter which
is every 90 days the logs are still
being saved in the bucket for forever
resulting two higher bills which means
there is no policy that we are just
dumping the logs again and again and
again and it is it is increasing your
bills exponentially
the task the major task is you need to
reduce the cost of storage by keeping
the logs only for 90 days how are you
going to do it pause the video think it through
through
let's check the answer
the answer is we'll create a life cycle
policies the first step will be moving
the objects to code line after 30 days
and the second option will be deleting
deleting the objects after 90 days we
need these logs for 30 days as a
standard storage as it is frequently
accessed by the development team so we
are not going to touch that for 30 days
after 30 days we'll directly move into
the cold Line storage because we need
every quarter
you know that if you need something
every quarter after 90 days we move it
to cold Line storage
we also need to save the third line
which is the data is being saved in
bucket for forever so we need to delete
the objects as the last line suggest
that we already need these logs for 90
days so after 90 days we are going to
delete that logs okay I hope this is
this is helpful to understand it that
how these all four things put together
works that's how you are going to
configure this case study
I hope this is clear and uh if you have
any question please uh comment and let
me know I'll try to answer them this
point around cloud storage CLI is called
GST it's a python application which lets
you access cloud storage from the
command line by using gsutil you can
create delete the buckets upload
download list move copy anything all
operational work you do it via gsut GS
util is very very powerful and very very
reliable uh utility by acli and by using
CLI you can do anything okay I really
recommend you to go through the
documentation link because it has a lot
of options it's this is gsutil
documentation and you can see all the
commands what geosutical can do for you
so for one of the example is gsutil CP
all the command have all a lot other
possibilities all these possibilities
you can find here
and I really recommend you to go ahead
and check few of them because this is
relevant for the exam as well as when
you work you should know all these
commands to work while you work with the
GS YouTube
all Google Cloud Storage right that sums
up our Google Cloud Storage topic and
thank you for your time thanks for
Clique em qualquer texto ou marcação de tempo para ir diretamente àquele momento do vídeo
Compartilhar:
A maioria das transcrições fica pronta em menos de 5 segundos
Cópia com um cliqueMais de 125 idiomasPesquisar no conteúdoIr para marcações de tempo
Cole a URL do YouTube
Insira o link de qualquer vídeo do YouTube para obter a transcrição completa
Formulário de extração de transcrição
A maioria das transcrições fica pronta em menos de 5 segundos
Instale nossa extensão para Chrome
Obtenha transcrições na hora sem sair do YouTube. Instale nossa extensão para Chrome e acesse com um clique a transcrição de qualquer vídeo direto na página de reprodução.