AASTHA BHARDWAJ: Welcome, my name is Aastha.
And I'm an engineer on the Cloud SQL team.
In this video, I'll show you how to create, run, and manage
SQL instances using Google Cloud SQL.
Cloud SQL helps manage mundane administrative tasks
for MySQL and Postgres databases.
So you can focus on what matters.
Let's walk through how to create a Postgres
database on Cloud SQL and connect to it from the Google
Cloud Shell.
You can set up an instance in just a few steps.
We'll start with the basics.
And I'll point out some options for additional configuration
along the way.
We'll start by navigating to Cloud SQL, in the GCP console,
and clicking Create Instance.
We'll select Postgres and press Next.
We'll give the instance a name.
And let's not forget to set the password for our default
account.
This instance will be created in the US.
And we'll leave the zone set to Any
so Cloud SQL can choose for us.
Let's take a look at the configuration options.
You can specify Instant Size, High Availability, and more.
For this demo, I'll choose four CPU cores
and then maximize the memory.
Maximizing memory is a good choice for Postgres,
because it can take advantage of the extra memory
for performance.
That said, don't worry too much about initial sizing.
You can scale the instance up or down later.
Let's increase the storage capacity to 200 gigabytes,
because increasing disk capacity also increases performance.
Check out the performance calculator below.
As I add capacity, my disk performance
increases, which will allow my database
to process more operations per second.
And I'll enable Automatic Storage
Increase so that I don't accidentally
run out of disk space.
Lastly, let's ensure that the database will automatically
provide isolation from failures.
We can do that by enabling the high availability
configuration, which, for Postgres, will automatically
failover to another zone in the case of an outage.
Now that we are happy with the configuration of our instance,
let's kick off the creation.
It may take a few minutes for your instance to create.
This is a great time to grab a quick cup of coffee.
You can also check the status of your instance
by navigating to your instance list.
Once you see a green check mark, your instance is ready.
Looks like our instance has finished creating.
Let's open the Details page to continue.
There are many ways to connect to this instance.
Within GCP, for example, we could
use App Engine, Compute Engine, or Container Engine,
but we could also connect, from just about anywhere,
by authorizing IP addresses or using the Cloud SQL Proxy.
For this demo, I'll connect using the Google Cloud Shell.
Cloud Shell provides command line access
to all of your cloud resources, such as Cloud SQL instances,
directly from the browser.
To open the Cloud Shell, click Connect Using Cloud Shell.
As you can see, the relevant gcloud command
to connect to your Cloud SQL instance
has been pre-typed for us.
So all we need to do is press Enter,
and then enter our root password from before,
and now we're connected.
So let's add some data.
I'll create a table, and we'll insert a few rows.
Finally, I'll make sure the data is now in our database.
And it is.
Great.
So to recap, in the last few minutes,
we just created a Cloud SQL instance,
with high performance and high availability,
and connected to it with Cloud Shell.
Now that you've seen how to get started, give it a try.
You can learn more about Google Cloud SQL and our free trial
program here.
Thank you for watching.