Google Cloud Platform provides 4 different types of services, including computer resources, storage, networking, and specialized services, like tools, big data (Dataproc, dataflow, IoT, Data fusion, Healthcare, Life sciences, Dataprep), AI (Data labeling, AP platform, natural language, Recommendations AI, Talent Solution, Translation, Vision, Video Intelligence).
- Virtual machine instance: a server that you can use to host a website, eCommerce shopping cart, and application. You can choose machine for general purpose (i.e. 1 vCPU, 3.75 memory), memory-optimized (96 vCPU, 1.4 TB memory), or compute-optimized (4 vCPU, 16 GB memory). You can also choose your own OS, like centOS, container optimized OS, coreOS, Debian, Deep learning on Linux, Red Hat Enterprise Linux, Red Hat for SAP, SQL Server on Windows Server, SUSE Linux Server, SUSE Linux Server for SAP, Ubuntu, Windows Server. Everything you can do on a local server, you can do it on the virtual machine. One cool thing you can play around is to implement a Tor website. You can stop and start the VM as needed to save your operating cost. The cost is billed by operating hr and the computer resource you have used. Another cool thing you can try is the autoscaling, where you can set up multiple VMs for your website, and have a single point of entry, and direct traffic to different VM based on traffic and configuration. VM will be added to the cluster as needed to meet unexpected traffics.
- Kubernetes engine/cluster: Kubernetes is an open-source container orchestration system used in the Google Cloud platform for automating application deployment, scaling, and management. Think of it as a car that is divided into multiple components by function, i.e. engine, radio, GPS, security, etc. One or more than one components are then installed into a black box. Each component still operated as they are connected together. If you need more horsepower, you can put more boxes with engine components. Similarly, the software can be separated into multiple services by function, each or multiple services are deployed into a container. All containers are installed in the server and connected, monitored, and controlled by Kubernetes. You can use Kubernetes to define the number of servers and containers within each server. Whenever one of the server/contains fail, a new server/container will be started to make up the loss.
- Serverless computing: both VM and Kubernetes are running an entire server with an operating system. Sometimes, we just need a single purpose function application for a long duration of time, like Point of Sale system; or, a single purpose function application for a short period of time, like an employee check-in time record. In this case, Google Cloud Platform provides App Engine for the long-duration single-purpose function application and Cloud Function for the short-period single function application.
- Unified Object storage (Google Bucket): object can be a file, structured data or unstructured data, image, etc. Object storage is the staging area before data is moved into other Google Cloud platforms like BigQuery, Dataproc, SQL database, or another service before processing. So, Object Storage is typically used for raw and intermediate data storage. Objects on Object storage are accessible worldwide, and it is optimized for secure and durable storage. Depending on the object accessing frequency, there are high frequency, less frequent, low frequency, and lowest frequency access Object Storage setups. Each object can be easily accessed through API and web services, etc. A good example is Cloud Storage Bucket.
- File Storage (Google Cloud Filestore): more or less online file storage, but you can easily access the file via Google API and other methods. The storage system is NFS.
- Block storage: where data is stored in a fixed-size called a block, the block size can be 4KB. Block-level storage is a concept in cloud data persistence where cloud services emulate the behavior of a traditional physical hard drive. Storage in such a drive is organized in blocks. The physical hard drive in Google Cloud is the “Disk”, which can be attached or detached from the VM, and the data will always be in the disk regardless of the attachment or VM start/stop status. This is also known as a persistent disk (for long term storage). On contract, there is an ephemeral disk that is for short term storage. A good example is Local SSD. Local SSDs are suitable only for temporary storage such as caches, processing space, or low-value data.
To add a zonal persistent disk to your VM instance, you can use the gcloud command-line by typing in
gcloud compute disks create [DISK_NAME] / --size [DISK_SIZE] / --type [DISK_TYPE]
Then attach the disk to the exisitng VM, by typing in
gcloud compute instances attach-disk [INSTANCE_NAME] / --disk [DISK_NAME]
Once the disk is attached to the VM, you have to mount the disk in order to access it as a folder (with an entry point). The previous gcloud command you enter them into the Google SDK, the rest Linux command you enter in the VM shell window. You can enter the shell window by clicking on the SSH button on VM.
You can list all the devices out first, usually, the bootable disk device ID is sda, then the new disk device ID is sdb,
sudo lsblk sudo mkfs.ext4 -m 0 -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/[DEVICE_ID]
Then, you can create a folder as the entry point for this new disk, mount it and grant it read and write access
sudo mkdir -p new-disk sudo mount -o discard,defaults /dev/[DEVICE_ID] /new-disk sudo chmod a+w /new-disk
Networking is the connection between cloud VMs, cloud services, your local company network, and local data center, etc. Each Google VM Instance have an internal and external IP, just like your computer within your home network, it has internal and external IP. External IP can be static and ephemeral. Ephemeral IP will be released back to the pool once the VM is stopped, whereas static IP is reserved for your VM. You can reserve the IP by going to the VPC network, external IP addresses, and reserve static address.