Using Google Cloud SQL to Secure Your Database

(Credit: Christine Cignoli)

Many companies are experiencing exponential increases in data storage and data management, which attracts hackers to sneak peek into the databases. In 2020, the number of data breaches in the U.S. had hit 1001 cases due to inadequate data security measures (Johnson). This article is for all the software engineer interns who are interested in hosting databases with top-tier security measures. The sections that follow outline a single solution with multiple steps that you can use to protect databases with Google Cloud SQL.

Cloud SQL is a fully-managed database service offered by Google Cloud Platform. It delivers security capabilities and the latest security technologies to secure internal services, which block unauthorized people from user’s databases. Due to Cloud SQL’s high performance and seamless integration, it supports the user during the entire process of database development.

Activating Google Cloud Account

Before you do anything, you must create a Gmail account and connect it with the Google Cloud Platform. With an existing Gmail Account, you can skip registering personal information and directly jump to the Google Cloud term page. within Google Cloud account, you can set up Cloud Identity for your organization, which enables collaboration between you and your coworkers. (Google Cloud Platform).

If you have difficulty signing up for a Google account, AWS and Azure offer similar Cloud services.

Enabling Google Cloud SQL Service

After creating a Google Cloud account, you are required to have a project for the Cloud SQL service. You need to configure a set of information to define how the project interacts with Google Cloud. Additionally, most of Google Cloud's features are inactive by default due to resource concerns. You must enable Cloud SQL API within the project you created (CloudSQL).

If you have questions regarding the terminology, consider going over Google Cloud basic tutorial before moving further.

Initializing a SQL Instance

Once Cloud SQL API is enabled, you need to initialize a SQL instance to store and operate database files. Google Cloud only supports three types of instances, which are MySQL, PostgreSQL, and SQL Server. Depending on the type of your local database system, you need to choose the exact same option for SQL instance creation.

If your preferred database system is not on the list, you can choose one of the three database options and manually create the database afterward.

Creating Database within SQL Instance

After the SQL instance set up correctly, load your SQL scripts to generate a database and insert data into the database tables. At this point, your Cloud SQL database works the exact same as your local database.

If GCP cannot process your SQL script, then you must use Cloud Shell to create the database. After activating the shell, you can type down your SQL queries to build a database.

Exposing the Database to Public

To connect the database with your own applications, you need to authenticate a specific IP address to the Cloud SQL database (Cloud SQL). After adding your IP address to Cloud SQL, you are authorized to view, manage, and protect the dataset through the internet.

If you don’t know your IP address location, you can launch a browser to search for it.


Using Google Cloud SQL to manage your database can effectively increase database security. It automatically updates the database management system and scales up, which makes the hackers move on to other targets. Thus, you can have fewer concerns about data security, and maintaining the focus on software development. Next, you may try to shift your applications onto Google Cloud and integrate them with your new database on Cloud SQL.

About Me:

I am a DevOps Engineer and Cybersecurity expert with 5 years of experience in software development. I joined Google Cloud Platform in May 2016 as a software executive.


Johnson, Joseph. “Annual number of data breaches and exposed records in the United States from 2005 to 2020.” 3 March 2021. Statista. Web. 7 May 2021.

Cignoli, Christine. “Cloud Covered: What was new with Google Cloud in September.” 07 Oct. 2019. Google The Keyword. Web. 19 May 2021.

Cloud SQL. “Cloud SQL for PostgreSQL documentation.” N.d. Google Cloud. Web. 19 May 2021.

Cloud SQL. “Configuring public IP connectivity.” N.d. Google Cloud. Web. 19 May 2021.

Google Cloud Platform. “Control creation of Google Cloud Platform projects.” N.d. Google WorkSpace Admin Help. Web. 19 May 2021.

pgAdmin. “Backup Dialog.” N.d. Web. 19 May 2021.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Themis Farming Campaign Round 2 Test-Net Version 2.0 is online NOW

Unauthorized Affiliate — error page

BEP-2 NOW Staking News

Why the NSA Called Me After Midnight and Requested My Source Code

Hello! I created 11 numbered NFT tokens, not very expensive, please look at serial number 1!

Online Identities and Identifications

Get Your Yoga Studio Ready for the GDPR

Private networking challenge: Easy Introduction to OpenVPN

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lejie Lin

Lejie Lin

More from Medium

Solution Recipe 6: Using Google Tag Manager’s Server-Side Tagging feature to pass data to Klaviyo

Butting heads with cloud security

Fraud: The invisible enemy of every App

Notifications to Mobile Device, from anywhere in 5 minutes