Objective

To understand and contrast the two primary methods for deploying a relational database in the cloud: the self-managed IaaS approach on a virtual machine and the fully-managed PaaS approach. This lab will provide direct experience with the trade-offs between control, convenience, security, and operational responsibility.

image.png

Start Where You Are

This lab builds directly on the concepts from Chapter 4: Let's Organize my Data Better. You will need the cloud accounts you created in Lab A. We will be using both the cloud console (GUI) and the command line, similar to Lab B.

Required Tool:

Before you begin, please download and install a free, cross-platform SQL client on your local computer. This tool will act as your command center for connecting to and querying your cloud databases. We recommend one of the following:

image.png

image.png

Part 1: The "Leased Farm" Approach (IaaS)

In this section, we will deploy a database the traditional way, echoing the "Build-It Corp" persona. We will rent the "land" (a virtual machine) and take on the full responsibility of installing, configuring, and securing the database ourselves. This gives us maximum control.

Step 1: Launch a Virtual Machine (VM)

Using the cloud console, create a small, general-purpose VM instance.

GCP: Navigate to Compute Engine -> VM instances -> Create Instance.
For the configuration, select a small Linux machine (e.g., e2-micro on GCP, with the latest **Ubuntu LTS image**. Name it fnamelname-db-vm.

After selecting the options you want, view the equivalent code.
 (just imagine you are in Best Buy, pick whatever you like - just remember to shut it down when we are done)
 This time, don't just look at the Command Line (for within Google Cloud Shell, in Google Specific Language, also view the Terraform syntax.
 Terraform is a vendor-agnostic tool that can manage resources across multiple cloud providers from a developer's local machine or an automated pipeline.

Create the virtual machine and wait for it to get ready.
Azure: Navigate to Virtual machines -> Create -> Azure virtual machine.
For the configuration, select a small Linux machine (e.g., B1s on Azure) with the latest Ubuntu LTS image. Name it fnamelname-db-vm.

Step 2: Install Database Software via Command Line

Once the VM is running, connect to it using SSH. (You can do this directly from the browser in the cloud console). Note that just how you can install a cloud SDK and connect to the cloud from your local computer, you can also install an SSH client (if you are on Windows, e.g PuTTy). If you are on a Unix or a Mac, there is a built in SSH connectivity in the terminal out of the box. One of the many reasons why developers and sys admins love Unix.